Skip to content

chore: upgrade Go to 1.23.0 #796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-go@v5
with:
cache: false
go-version: "1.22"
go-version: "1.23"
- name: Build
if: matrix.os == 'ubuntu-22.04'
run: make build
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ jobs:
uses: actions/setup-go@v5
with:
cache: false
# This can't be upgraded until the issue with sys.daemon on Windows is resolved
# After the issue is resolved, this can be set to 1.22
go-version: "1.22.4"
go-version: "1.23"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ jobs:
uses: actions/setup-go@v5
with:
cache: false
# This can't be upgraded until the issue with sys.daemon on Windows is resolved
# After the issue is resolved, this can be set to 1.22
go-version: "1.22.4"
go-version: "1.23"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-go@v5
with:
cache: false
go-version: "1.22"
go-version: "1.23"
- name: Validate
if: matrix.os == 'ubuntu-22.04'
run: make validate
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ jobs:
- uses: actions/setup-go@v5
with:
cache: false
go-version: "1.22"
go-version: "1.23"
- run: make init-docs
- run: make validate-docs
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ smoke: build
smoke:
go test -v -tags='smoke' ./pkg/tests/smoke/...

GOLANGCI_LINT_VERSION ?= v1.59.0
GOLANGCI_LINT_VERSION ?= v1.60.1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bump to support Go 1.23

lint:
if ! command -v golangci-lint &> /dev/null; then \
echo "Could not find golangci-lint, installing version $(GOLANGCI_LINT_VERSION)."; \
Expand Down
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module github.com/gptscript-ai/gptscript

// This can't be upgraded until the issue with sys.daemon on Windows is resolved
go 1.22.4
go 1.23.0

require (
github.com/AlecAivazis/survey/v2 v2.3.7
Expand Down
2 changes: 1 addition & 1 deletion pkg/loader/openapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func getOpenAPITools(t *openapi3.T, defaultHost, source, targetToolName string)
pathObj := pathMap[pathString]
// Handle path-level server override, if one exists
pathServer := defaultServer
if pathObj.Servers != nil && len(pathObj.Servers) > 0 {
if len(pathObj.Servers) > 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New linter complaint.

pathServer, err = parseServer(pathObj.Servers[0])
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/openapi/getschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func GetSchema(operationID, defaultHost string, t *openapi3.T) (string, Operatio
for path, pathItem := range t.Paths.Map() {
// Handle path-level server override, if one exists.
pathServer := defaultServer
if pathItem.Servers != nil && len(pathItem.Servers) > 0 {
if len(pathItem.Servers) > 0 {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New linter complaint.

pathServer, err = parseServer(pathItem.Servers[0])
if err != nil {
return "", OperationInfo{}, false, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/repos/runtimes/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var Runtimes = []repos.Runtime{
Default: true,
},
&golang.Runtime{
Version: "1.22.1",
Version: "1.23.0",
},
}

Expand Down
20 changes: 10 additions & 10 deletions pkg/repos/runtimes/golang/digests.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
3bc971772f4712fec0364f4bc3de06af22a00a12daab10b6f717fdcd13156cc0 go1.22.1.darwin-amd64.tar.gz
943e4f9f038239f9911c44366f52ab9202f6ee13610322a668fe42406fb3deef go1.22.1.darwin-amd64.pkg
f6a9cec6b8a002fcc9c0ee24ec04d67f430a52abc3cfd613836986bcc00d8383 go1.22.1.darwin-arm64.tar.gz
5f10b95e2678618f85ba9d87fbed506b3b87efc9d5a8cafda939055cb97949ba go1.22.1.darwin-arm64.pkg
8484df36d3d40139eaf0fe5e647b006435d826cc12f9ae72973bf7ec265e0ae4 go1.22.1.linux-386.tar.gz
aab8e15785c997ae20f9c88422ee35d962c4562212bb0f879d052a35c8307c7f go1.22.1.linux-amd64.tar.gz
e56685a245b6a0c592fc4a55f0b7803af5b3f827aaa29feab1f40e491acf35b8 go1.22.1.linux-arm64.tar.gz
8cb7a90e48c20daed39a6ac8b8a40760030ba5e93c12274c42191d868687c281 go1.22.1.linux-armv6l.tar.gz
0c5ebb7eb39b7884ec99f92b425d4c03a96a72443562aafbf6e7d15c42a3108a go1.22.1.windows-386.zip
cf9c66a208a106402a527f5b956269ca506cfe535fc388e828d249ea88ed28ba go1.22.1.windows-amd64.zip
ffd070acf59f054e8691b838f274d540572db0bd09654af851e4e76ab88403dc go1.23.0.darwin-amd64.tar.gz
bc91d2573939a01731413fac0884c329606c1c168883692131ce772669caf27b go1.23.0.darwin-amd64.pkg
b770812aef17d7b2ea406588e2b97689e9557aac7e646fe76218b216e2c51406 go1.23.0.darwin-arm64.tar.gz
d73ae741ed449ea842238f76f4b02935277eb867689f84ace0640965b2caf700 go1.23.0.darwin-arm64.pkg
0e8a7340c2632e6fb5088d60f95b52be1f8303143e04cd34e9b2314fafc24edd go1.23.0.linux-386.tar.gz
905a297f19ead44780548933e0ff1a1b86e8327bb459e92f9c0012569f76f5e3 go1.23.0.linux-amd64.tar.gz
62788056693009bcf7020eedc778cdd1781941c6145eab7688bd087bce0f8659 go1.23.0.linux-arm64.tar.gz
0efa1338e644d7f74064fa7f1016b5da7872b2df0070ea3b56e4fef63192e35b go1.23.0.linux-armv6l.tar.gz
09448fedec0cdf98ad12397222e0c8bfc835b1d0894c0015ced653534b8d7427 go1.23.0.windows-386.zip
d4be481ef73079ee0ad46081d278923aa3fd78db1b3cf147172592f73e14c1ac go1.23.0.windows-amd64.zip
2 changes: 1 addition & 1 deletion pkg/repos/runtimes/golang/golang_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestRuntime(t *testing.T) {
os.RemoveAll("testdata/bin")
})
r := Runtime{
Version: "1.22.1",
Version: "1.23.0",
}

s, err := r.Setup(context.Background(), types.Tool{}, testCacheHome, "testdata", os.Environ())
Expand Down
2 changes: 1 addition & 1 deletion pkg/repos/runtimes/golang/testdata/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module example.com

go 1.22.1
go 1.23.0
2 changes: 1 addition & 1 deletion pkg/repos/runtimes/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (r *Runtime) runNPM(ctx context.Context, tool types.Tool, toolSource, binDi
if tool.WorkingDir == "" {
return nil
}
if _, err := os.Stat(filepath.Join(tool.WorkingDir, packageJSON)); errors.Is(fs.ErrNotExist, err) {
if _, err := os.Stat(filepath.Join(tool.WorkingDir, packageJSON)); errors.Is(err, fs.ErrNotExist) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New linter complaint, which is actually a bug.

return nil
} else if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion pkg/sdkserver/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func (s *server) parse(w http.ResponseWriter, r *http.Request) {
} else {
content, loadErr := input.FromLocation(reqObject.File, reqObject.DisableCache)
if loadErr != nil {
logger.Errorf(loadErr.Error())
logger.Errorf("failed to load file: %v", loadErr)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New linter complaint.

writeError(logger, w, http.StatusInternalServerError, loadErr)
return
}
Expand Down