"itemRepository" targetSourceFileName = "item_repository.go" targetMethodName = "setContext" ) // AST解析で各メソッドがsetContextを呼んでいるかチェック gotCallMap, err := CheckMethodCallsInStruct(targetSourceFileName, targetStructName, targetMethodName) if err != nil { t.Fatal(err) } wantCallMap := map[string]bool{ "List": true, "GetByID": true, } if !reflect.DeepEqual(wantCallMap, gotCallMap) { t.Errorf("Method list mismatch.\nWanted: %v\nGot: %v", wantCallMap, gotCallMap) } } ©2025 Dr.'s Prime ,Inc.