Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Expanding "Assignment to Entry in Nil Map" with struct fields #96

Description

@abitrolly

It may worth expanding https://containersolutions.github.io/runbooks/posts/golang/assignment-to-entry-in-nil-map/ with a case when map is a part of a struct.

While the solution is the same, the difficulty is to find the right place to initialize the struct, which most likely will be "NewSomething" function.

https://stackoverflow.com/questions/27553399/golang-how-to-initialize-a-map-field-within-a-struct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions