Skip to content

Commit a951f71

Browse files
feat(functions):troubleshoot go version
1 parent b8b381c commit a951f71

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
meta:
3+
title: Go function build fails due to go version
4+
description: Troubleshoot issues with Scaleway Serverless Functions Go build not working due to version error.
5+
content:
6+
h1: Go function build fails due to go version
7+
paragraph: Troubleshoot issues with Scaleway Serverless Functions Go build not working due to version error.
8+
tags: serverless functions troubleshooting issue error go version build
9+
dates:
10+
validation: 2025-04-30
11+
posted: 2025-04-30
12+
categories:
13+
- serverless
14+
---
15+
16+
## Problem
17+
18+
My Go Serverless Function build failed with an error message about the wrong version.
19+
20+
## Cause
21+
22+
When deploying a Go function, build step can fail with an error about the version of code versus version of the runtime even if the version seems correct.
23+
24+
This is due to the `go.mod` directive that specify a `X.Y.Z` version where the `Z` version does not match.
25+
26+
This happens by default because in go toolchain, the `go mod init` command now adds the version.
27+
28+
## Possible solution
29+
30+
Remove the `Z` version from the gomod.
31+
32+
Wrong go.mod example:
33+
34+
```
35+
go 1.24.1
36+
```
37+
38+
Fixed:
39+
40+
```
41+
go 1.24
42+
````

0 commit comments

Comments
 (0)