diff --git a/templates/http-go/content/go.mod b/templates/http-go/content/go.mod index 310e04acdd..162913a195 100644 --- a/templates/http-go/content/go.mod +++ b/templates/http-go/content/go.mod @@ -1,7 +1,15 @@ module github.com/{{project-name | snake_case}} -go 1.22 +go 1.25.5 -require github.com/spinframework/spin-go-sdk/v2 v2.2.1 +require github.com/spinframework/spin-go-sdk/v3 v3.0.0 -require github.com/julienschmidt/httprouter v1.3.0 // indirect +require ( + github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13 // indirect + github.com/bytecodealliance/componentize-go v0.3.3 // indirect + github.com/gofrs/flock v0.13.0 // indirect + go.bytecodealliance.org/pkg v0.2.1 // indirect + golang.org/x/sys v0.37.0 // indirect +) + +tool github.com/bytecodealliance/componentize-go \ No newline at end of file diff --git a/templates/http-go/content/go.sum b/templates/http-go/content/go.sum index 447c042d52..f9165ab52d 100644 --- a/templates/http-go/content/go.sum +++ b/templates/http-go/content/go.sum @@ -1,4 +1,23 @@ -github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= -github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= -github.com/spinframework/spin-go-sdk/v2 v2.2.1 h1:ceAbRU+D3xmyZ8ScDLeFoT763ikFIUEmSjgsrD11v8k= -github.com/spinframework/spin-go-sdk/v2 v2.2.1/go.mod h1:vocVZB4qlTG8C5yoliKIAJCuv4x7sqK0GmVkWeD9N/A= +github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13 h1:JtuelWqyixKApmXm3qghhZ7O96P6NKpyrlSIe8Rwnhw= +github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13/go.mod h1:7kfpUbyCdGJ9fDRCp3fopPQi5+cKNHgTE4ZuNrO71Cw= +github.com/bytecodealliance/componentize-go v0.3.3 h1:8OA2qjWQA45vTMy5e1dboCOBqhAArUfMtVWlWSLJl/k= +github.com/bytecodealliance/componentize-go v0.3.3/go.mod h1:w1QFtPLGI9o38epvMOPyCKbMc7q7GJ7yZhIvhGTpzA0= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= +github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spinframework/spin-go-sdk/v3 v3.0.0 h1:YI5HTK0wXDu6KIZ3dzTqszqhnyGrnt4m7vH9judUkcA= +github.com/spinframework/spin-go-sdk/v3 v3.0.0/go.mod h1:TBYpyA7BXVL/7+uUJrNDA+OdlLFg3+NSvXSK7HVI1N4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +go.bytecodealliance.org/pkg v0.2.1 h1:TdRagooIcCW3UmlKqVO4cDR3GNDyfDnbiBzGI6TOvyg= +go.bytecodealliance.org/pkg v0.2.1/go.mod h1:OjA+V8g3uUFixeCKFfamm6sYhTJdg8fvwEdJ2GO0GSk= +golang.org/x/sys v0.0.0-20190509141414-a5b02f93d862/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= +golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/templates/http-go/content/main.go b/templates/http-go/content/main.go index ec62db7c30..809db97f8e 100644 --- a/templates/http-go/content/main.go +++ b/templates/http-go/content/main.go @@ -4,7 +4,7 @@ import ( "fmt" "net/http" - spinhttp "github.com/spinframework/spin-go-sdk/v2/http" + spinhttp "github.com/spinframework/spin-go-sdk/v3/http" ) func init() { @@ -13,3 +13,6 @@ func init() { fmt.Fprintln(w, "Hello World!") }) } + +// main function must be included for the compiler but is not executed. +func main() {} diff --git a/templates/http-go/content/spin.toml b/templates/http-go/content/spin.toml index fe25efb3fc..7143b5d127 100644 --- a/templates/http-go/content/spin.toml +++ b/templates/http-go/content/spin.toml @@ -16,5 +16,5 @@ component = "{{project-name | kebab_case}}" source = "main.wasm" allowed_outbound_hosts = [] [component.{{project-name | kebab_case}}.build] -command = "tinygo build -target=wasip1 -buildmode=c-shared -no-debug -o main.wasm ." +command = "go tool componentize-go build" watch = ["**/*.go", "go.mod"] diff --git a/templates/http-go/metadata/spin-template.toml b/templates/http-go/metadata/spin-template.toml index 05ef439b72..2eb8bd296d 100644 --- a/templates/http-go/metadata/spin-template.toml +++ b/templates/http-go/metadata/spin-template.toml @@ -1,6 +1,6 @@ manifest_version = "1" id = "http-go" -description = "HTTP request handler using (Tiny)Go" +description = "HTTP request handler using Go" tags = ["http", "go"] [add_component] diff --git a/templates/redis-go/content/go.mod b/templates/redis-go/content/go.mod index 4f318cbbb5..162913a195 100644 --- a/templates/redis-go/content/go.mod +++ b/templates/redis-go/content/go.mod @@ -1,5 +1,15 @@ module github.com/{{project-name | snake_case}} -go 1.22 +go 1.25.5 -require github.com/spinframework/spin-go-sdk/v2 v2.2.1 +require github.com/spinframework/spin-go-sdk/v3 v3.0.0 + +require ( + github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13 // indirect + github.com/bytecodealliance/componentize-go v0.3.3 // indirect + github.com/gofrs/flock v0.13.0 // indirect + go.bytecodealliance.org/pkg v0.2.1 // indirect + golang.org/x/sys v0.37.0 // indirect +) + +tool github.com/bytecodealliance/componentize-go \ No newline at end of file diff --git a/templates/redis-go/content/go.sum b/templates/redis-go/content/go.sum index d853fe4454..f9165ab52d 100644 --- a/templates/redis-go/content/go.sum +++ b/templates/redis-go/content/go.sum @@ -1,2 +1,23 @@ -github.com/spinframework/spin-go-sdk/v2 v2.2.1 h1:ceAbRU+D3xmyZ8ScDLeFoT763ikFIUEmSjgsrD11v8k= -github.com/spinframework/spin-go-sdk/v2 v2.2.1/go.mod h1:vocVZB4qlTG8C5yoliKIAJCuv4x7sqK0GmVkWeD9N/A= +github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13 h1:JtuelWqyixKApmXm3qghhZ7O96P6NKpyrlSIe8Rwnhw= +github.com/apparentlymart/go-userdirs v0.0.0-20200915174352-b0c018a67c13/go.mod h1:7kfpUbyCdGJ9fDRCp3fopPQi5+cKNHgTE4ZuNrO71Cw= +github.com/bytecodealliance/componentize-go v0.3.3 h1:8OA2qjWQA45vTMy5e1dboCOBqhAArUfMtVWlWSLJl/k= +github.com/bytecodealliance/componentize-go v0.3.3/go.mod h1:w1QFtPLGI9o38epvMOPyCKbMc7q7GJ7yZhIvhGTpzA0= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gofrs/flock v0.13.0 h1:95JolYOvGMqeH31+FC7D2+uULf6mG61mEZ/A8dRYMzw= +github.com/gofrs/flock v0.13.0/go.mod h1:jxeyy9R1auM5S6JYDBhDt+E2TCo7DkratH4Pgi8P+Z0= +github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/spinframework/spin-go-sdk/v3 v3.0.0 h1:YI5HTK0wXDu6KIZ3dzTqszqhnyGrnt4m7vH9judUkcA= +github.com/spinframework/spin-go-sdk/v3 v3.0.0/go.mod h1:TBYpyA7BXVL/7+uUJrNDA+OdlLFg3+NSvXSK7HVI1N4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +go.bytecodealliance.org/pkg v0.2.1 h1:TdRagooIcCW3UmlKqVO4cDR3GNDyfDnbiBzGI6TOvyg= +go.bytecodealliance.org/pkg v0.2.1/go.mod h1:OjA+V8g3uUFixeCKFfamm6sYhTJdg8fvwEdJ2GO0GSk= +golang.org/x/sys v0.0.0-20190509141414-a5b02f93d862/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= +golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/templates/redis-go/content/main.go b/templates/redis-go/content/main.go index 50ed538a14..3251179831 100644 --- a/templates/redis-go/content/main.go +++ b/templates/redis-go/content/main.go @@ -3,7 +3,7 @@ package main import ( "fmt" - "github.com/spinframework/spin-go-sdk/v2/redis" + "github.com/spinframework/spin-go-sdk/v3/redis" ) func init() { @@ -14,3 +14,6 @@ func init() { return nil }) } + +// main function must be included for the compiler but is not executed. +func main() {} diff --git a/templates/redis-go/content/spin.toml b/templates/redis-go/content/spin.toml index d885829905..f3a54f0a16 100644 --- a/templates/redis-go/content/spin.toml +++ b/templates/redis-go/content/spin.toml @@ -19,4 +19,4 @@ component = "{{project-name | kebab_case}}" source = "main.wasm" allowed_outbound_hosts = [] [component.{{project-name | kebab_case}}.build] -command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ." +command = "go tool componentize-go -w spin:up/redis-trigger@4.0.0 build" \ No newline at end of file diff --git a/templates/redis-go/metadata/spin-template.toml b/templates/redis-go/metadata/spin-template.toml index 09b5be754d..50e9ed9c87 100644 --- a/templates/redis-go/metadata/spin-template.toml +++ b/templates/redis-go/metadata/spin-template.toml @@ -1,6 +1,6 @@ manifest_version = "1" id = "redis-go" -description = "Redis message handler using (Tiny)Go" +description = "Redis message handler using Go" tags = ["redis", "go"] [parameters]