bubusiB
Windmill7mo ago
7 replies
bubusi

# Go Script Package Conflict Error

Getting consistent build errors when trying to run any Go script in Windmill:

exit code for "go build": 1
main.go:7:5: found packages main (inner_main.go) and inner (runner.go) in /tmp/windmill/.../go/inner
main.go:7:5: import "mymod/inner" is a program, not an importable package


What I've tried:
- package main with func main()
- package inner with func Main()
- No package declaration
- // +build ignore directive
- Even simplest scripts fail

Example script:
package main

import "fmt"

func main(name string) (string, error) {
    return fmt.Sprintf("Hello, %s!", name), nil
}


Questions:
1. What's the correct package/function signature for Go in Windmill?
2. How should dependencies be declared?
3. Any working Go script examples?

The error mentions inner_main.go and runner.go - are these Windmill-generated? How should my script interact with them?

Context: Trying to migrate performance-critical DB connectors from TS to Go. TypeScript/Python work fine, only Go has issues.

Thanks!
Was this page helpful?