Skip to content

Commit 66796fa

Browse files
committed
fix(pkl): bind ArtifactConfig.Repositories as []*Repository
PKL's Listing<ClassType> decodes into Go via reflection as a slice of pointers, not values. Declaring the field as []Repository panicked with "reflect.Set: value of type *model.Repository is not assignable to type model.Repository" the first time PKL produced a non-empty repositories listing. Match the pattern used elsewhere (e.g., FilterCondition conditions) and use a pointer slice. The translation layer at pkl.go:720 reads through the pointer transparently.
1 parent b55f59e commit 66796fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/schema/pkl/model/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ type ArtifactConfig struct {
184184
URL url.URL `pkl:"url"`
185185
Username string `pkl:"username"`
186186
Password string `pkl:"password"`
187-
Repositories []Repository `pkl:"repositories"`
187+
Repositories []*Repository `pkl:"repositories"`
188188
}
189189

190190
type CliConfig struct {

0 commit comments

Comments
 (0)