Skip to content

Map() does not panic on zero-initialized value #9025

@mackjmr

Description

@mackjmr

Describe the bug
The following code will not cause a panic:

var test pcommon.Value

func main() {
	test.Map()
}

although the doc states:

Calling this function on zero-initialized Value will cause a panic.

Steps to reproduce

package main

import (
	"go.opentelemetry.io/collector/pdata/pcommon"
)

var test pcommon.Value

func main() {
	test.Map()
}

What did you expect to see?
A Panic.

What did you see instead?
No Panic.

What version did you use?

require go.opentelemetry.io/collector/pdata v1.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:pdatapdata module related issuesbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions