structTags in generator-settings.pkl caused pkl-gen-go to panic #106

Closed
opened 2025-12-30 01:20:53 +01:00 by adam · 2 comments
Owner

Originally created by @Huang-Wei on GitHub (Mar 8, 2024).

Repro steps:

  • install pkl-gen-go's latest version
  • pkl-gen-go --version shows 0.5.3
  • craft a generator-settings.pkl with the folllowing content
structTags {
  ["yaml"] = "%{name},omitempty"
}
  • pkl-gen-go --version panics:
⇒  pkl-gen-go --version
panic: invalid code for slices: 1

goroutine 1 [running]:
main.init.1()
	/Users/weih/go/pkg/mod/github.com/apple/pkl-go@v0.5.3/cmd/pkl-gen-go/pkl-gen-go.go:191 +0x700
Originally created by @Huang-Wei on GitHub (Mar 8, 2024). Repro steps: - install pkl-gen-go's latest version - `pkl-gen-go --version` shows `0.5.3` - craft a `generator-settings.pkl` with the folllowing content ``` structTags { ["yaml"] = "%{name},omitempty" } ``` - `pkl-gen-go --version` panics: ``` ⇒ pkl-gen-go --version panic: invalid code for slices: 1 goroutine 1 [running]: main.init.1() /Users/weih/go/pkg/mod/github.com/apple/pkl-go@v0.5.3/cmd/pkl-gen-go/pkl-gen-go.go:191 +0x700 ```
adam closed this issue 2025-12-30 01:20:53 +01:00
Author
Owner

@stackoverflow commented on GitHub (Mar 11, 2024):

Can you create this issue in the pkl-go repo?

@stackoverflow commented on GitHub (Mar 11, 2024): Can you create this issue in the [pkl-go](https://github.com/apple/pkl-go) repo?
Author
Owner

@Huang-Wei commented on GitHub (Mar 11, 2024):

Can you create this issue in the pkl-go repo?

Sure, here it is: https://github.com/apple/pkl-go/issues/28.

(close this issue and track it in pkl-go)

@Huang-Wei commented on GitHub (Mar 11, 2024): > Can you create this issue in the [pkl-go](https://github.com/apple/pkl-go) repo? Sure, here it is: https://github.com/apple/pkl-go/issues/28. (close this issue and track it in pkl-go)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#106