Skip to content

Structs within slices or maps inside a marshalled struct are not checked #59

@egorbunov

Description

@egorbunov

musttag does not report forgotten A struct annotations in the example below:

package main

import "encoding/json"

type A struct {
	Name string
}

type B struct {
	Slice []A          `json:"slice"`
	Map   map[string]A `json:"map"`       
}

func main() {
	_, _ = json.Marshal(B{})
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions