I'm trying to build a POST body in Go, but I keep getting the following error:
invalid composite literal type string
Snippets of my code and structs are below, I'm can't figure out what I'm doing wrong?
postData := projectPostData{
Filters: projectFilters{
Name: string{ // <-- Error is referred to on this line
target,
},
},
}
type projectPostData struct {
Filters projectFilters `json:"filters,omitempty"`
}
type projectFilters struct {
Name string `json:"name,omitempty"`
}