WindmillWWindmill
Powered by
bubusiB
Windmill•8mo 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
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
package main
with
func main()
func main()

-
package inner
package inner
with
func Main()
func Main()

- No package declaration
-
// +build ignore
// +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
}
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
inner_main.go
and
runner.go
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!
WindmillJoin
3,362Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

Import error script not found
EnterEEnter / help
3y ago
Front-end Table Script Error
Trevor SullivanTTrevor Sullivan / help
3y ago
Error Handler Option Not Allowing Custom Script
kroccKkrocc / help
8mo ago
Error while executing Bun script: missing sourcemaps
invakid404Iinvakid404 / help
2y ago