Choosing Go version when using CNB Tiny

I’m using the CNB Tiny buildpack, but it seems to use Go 1.14 even if my mod file specifies 1.15. I’m seeing the following output:

[builder] Paketo Go Distribution Buildpack 0.1.0
[builder]   Resolving Go version
[builder]     Candidate version sources (in priority order):
[builder]       <unknown> -> ""
[builder]       <unknown> -> ""
[builder] 
[builder]     Selected Go version (using <unknown>): 1.14.7
[builder] 
[builder]   Executing build process
[builder]     Installing Go 1.14.7
[builder]       Completed in 4.576s
[builder] 
[builder] Paketo Go Mod Vendor Buildpack 0.0.164
[builder]   Executing build process
[builder]     Running 'go mod vendor'
[builder]       Completed in 4.901s
[builder] 
[builder] Paketo Go Build Buildpack 0.0.32
[builder]   Executing build process
[builder]     Running 'go build -o /layers/paketo-buildpacks_go-build/targets/bin -buildmode pie -mod vendor .'
[builder]       Completed in 11.917s
[builder] 

Is there a way to set the Go version manually or have it respect the go.mod file?

Re respecting the go.mod version, that’s an outstanding issue on the go buildpack - https://github.com/paketo-buildpacks/go-dist/issues/102

The default Go on the go-dist buildpack component is currently defaulted to 1.14. https://github.com/paketo-buildpacks/go-dist/releases

I’ll look into it and see what can be done.

Ok,

add a buildpack.yml file with

go:
  version=1.15

And that should get you building with 1.15

The yaml should be

go:
  version: 1.15

not =, but works great, thanks :+1:

Ach! Fixed… I blame too many configuration file formats. :slight_smile: