INNER CODE UNIT · Go

main

stacklok/toolhive · cmd/help/ogen-client-wrapper/main.go:18

func main() {
	if len(os.Args) != 2 {
		fmt.Fprintln(os.Stderr, "usage: ogen-client-wrapper <oas_client_gen.go>")
		os.Exit(2)
	}
	if err := renameConstructor(os.Args[1]); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}

func renameConstructor(path string) error {
	fileSet := token.NewFileSet()
	file, err := parser.ParseFile(fileSet, path, nil, parser.ParseComments)
	if err != nil {
		return fmt.Errorf("parse generated client: %w", err)
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…