Skip to content

Assignment to entry in nil map in ServiceClient.Request #2798

@dtantsur

Description

@dtantsur

The code writes to MoreHeaders without initializing it. The actual initialization happens in Get/Post/etc, so if you use Request directly, you can get:

panic: assignment to entry in nil map

goroutine 1 [running]:
github.com/gophercloud/gophercloud.(*ServiceClient).Request(0xc00010fa90, {0x6efecb, 0x3}, {0xc00001e100, 0x1a}, 0xc?)
        /home/dtantsur/gophercloud/service_client.go:150 +0x147
github.com/gophercloud/gophercloud/openstack/utils.GetSupportedMicroversions({0xc00013c000, {0xc00001e100, 0x1a}, {0x0, 0x0}, {0x6f117e, 0x9}, {0x0, 0x0}, 0xc00002ac90})
        /home/dtantsur/gophercloud/openstack/utils/choose_version.go:130 +0xd1
main.main()
        /home/dtantsur/gophercloud/main/main.go:26 +0x98

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions