Skip to content

Commit

Permalink
Merge pull request #11 from gazebo-web/go_1_19
Browse files Browse the repository at this point in the history
Bump Go version to 1.19
  • Loading branch information
marcoshuck committed Feb 13, 2023
2 parents db95c86 + d185ed9 commit bcaabe3
Show file tree
Hide file tree
Showing 19 changed files with 115 additions and 336 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.14'
go-version: '1.19'

- name: Test
env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Idea taken from here:
# https://github.com/docker-library/docs/blob/6b6b3f34023ab90821453ed1e88e7e9165c6b0d1/.template-helpers/variant-onbuild.md

FROM golang:1.14.2
FROM golang:1.19

RUN apt-get update && apt-get install -y nano vim && \
git config --global user.name "gz-fuelserver" && \
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@

# Install

1. [Go version 1.14](https://golang.org/dl/) or above.
1. [Go version 1.19](https://golang.org/dl/) or above.

Make sure to set the following environment variables:

1. `$PATH`: Set environment variable to point to the `bin` directory of where you installed Go so your system can find the `go` executable.
1. `$PATH`: Set environment variable to point to the `bin` directory of where you installed Go so your system can
find the `go` executable.

1. `$GOPATH`: This is the working directory of your go project. Project dependencies and binaries will be installed to this path. If the environment variable is unset, by default Go will point to the `$HOME/go` directory.
1. `$GOPATH`: This is the working directory of your go project. Project dependencies and binaries will be installed
to this path. If the environment variable is unset, by default Go will point to the `$HOME/go` directory.


1. Download the server code
Expand Down
4 changes: 1 addition & 3 deletions application.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ import (
"github.com/gazebo-web/fuel-server/vcs"
"github.com/gazebo-web/gz-go/v7"
"github.com/go-playground/form"
"io/ioutil"

"gopkg.in/go-playground/validator.v9"
"log"
"net/http"
Expand Down Expand Up @@ -86,7 +84,7 @@ func init() {

if isGoTest {
// Override globals.ResourceDir with a newly created /tmp folder
globals.ResourceDir, err = ioutil.TempDir("", "fuel-")
globals.ResourceDir, err = os.MkdirTemp("", "fuel-")
if err != nil {
log.Fatal("Could not initialize test globals.ResourceDir. Resources will not be available")
}
Expand Down
6 changes: 3 additions & 3 deletions bundles/worlds/worlds_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"encoding/xml"
"fmt"
"github.com/gazebo-web/gz-go/v7"
"io/ioutil"
"io"
"log"
"net/url"
"os"
Expand Down Expand Up @@ -659,7 +659,7 @@ func populateModelIncludes(ctx context.Context, tx *gorm.DB, world *World,
// Otherwise it returns an error.
func getWorldMainFile(worldDirPath string) (*string, error) {
// TODO: an uploaded world folder can have multiple world files (with extension .world/.sdf)
files, err := ioutil.ReadDir(worldDirPath)
files, err := os.ReadDir(worldDirPath)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -701,7 +701,7 @@ func parseModelIncludes(tx *gorm.DB, world *World,
}
}(xmlFile)

b, err := ioutil.ReadAll(xmlFile)
b, err := io.ReadAll(xmlFile)
if err != nil {
return nil, gz.NewErrorMessageWithBase(gz.ErrorFormInvalidValue, err)
}
Expand Down
4 changes: 2 additions & 2 deletions database.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"github.com/gazebo-web/gz-go/v7"
"github.com/gosimple/slug"
"io/ioutil"
"io"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -420,7 +420,7 @@ func DBPopulate(ctx context.Context, path string, db *gorm.DB, onlyWhenEmpty boo
log.Println("Failed to close file:", err)
}
}(xmlFile)
b, err := ioutil.ReadAll(xmlFile)
b, err := io.ReadAll(xmlFile)
if err != nil {
return err
}
Expand Down
27 changes: 26 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/gazebo-web/fuel-server

go 1.14
go 1.19

require (
github.com/Selvatico/go-mocket v1.0.4
Expand All @@ -24,12 +24,37 @@ require (
)

require (
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
github.com/auth0/go-jwt-middleware v0.0.0-20200507191422-d30d7b9ece63 // indirect
github.com/codegangsta/negroni v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/denisenkom/go-mssqldb v0.0.0-20191128021309-1d7a30a10f73 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/go-playground/locales v0.13.0 // indirect
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/jinzhu/now v1.1.1 // indirect
github.com/jmespath/go-jmespath v0.3.0 // indirect
github.com/jpillora/go-ogle-analytics v0.0.0-20161213085824-14b04e0594ef // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/leodido/go-urn v1.2.0 // indirect
github.com/lib/pq v1.7.0 // indirect
github.com/mattn/go-sqlite3 v2.0.2+incompatible // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mssola/user_agent v0.5.3 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be // indirect
github.com/rollbar/rollbar-go v1.2.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/src-d/gcfg v1.4.0 // indirect
github.com/urfave/negroni v1.0.0 // indirect
github.com/xanzy/ssh-agent v0.2.1 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd // indirect
golang.org/x/sys v0.0.0-20220209214540-3681064d5158 // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit bcaabe3

Please sign in to comment.