-1
이 Go 프로그램을 실행하는 동안 다음 오류가 발생합니다. 내가 무엇을 놓치고 있는지 확실하지 않다. "누락 된 복합 리터럴 형식"오류
package main
import (
"fmt"
)
type LI struct {
Id int `json:"id"`
}
type TP struct {
Name string `json:"name"`
Value string `json:"value"`
}
type LTI struct {
Leads []LI `json:"leads"`
Tokens []TP `json:"tokens,omitempty"`
}
type RCR struct {
Input LTI `json:"input"`
}
func main() {
fmt.Println("Hello, playground")
leadIdInput := LI{Id: 55213}
leadTokensInput := LTI{{[]LI{leadIdInput}, nil}}
rCR := RCR{Input: leadTokensInput}
fmt.Println("rCR is '%+v'", rCR.Input.Leads[0])
}
.\m.go:28: missing type in composite literal
.\m.go:28: too few values in struct initializer
이 도와주세요.
@skm이게 도움이되기를 바랍니다. –