Skip to content

Commit

Permalink
Require Go 1.17 for module (#111)
Browse files Browse the repository at this point in the history
Require Go 1.17 for the module and update all scripts to use the "go install pkg@version" format for any tool installs.

Remove appveyor config. Windows testing happens on Jenkins.
  • Loading branch information
andrewkroh authored May 25, 2022
1 parent b588643 commit f2015f1
Show file tree
Hide file tree
Showing 22 changed files with 32 additions and 80 deletions.
61 changes: 0 additions & 61 deletions .appveyor.yml

This file was deleted.

7 changes: 3 additions & 4 deletions .ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ pipeline {
BASE_DIR = "src/github.com/elastic/${env.REPO}"
JOB_GIT_CREDENTIALS = "f6c7695a-671e-4f4f-a331-acdce44ff9ba"
PIPELINE_LOG_LEVEL = 'INFO'
GO111MODULE = 'on'
}
options {
timeout(time: 1, unit: 'HOURS')
Expand Down Expand Up @@ -38,7 +37,7 @@ pipeline {
axes {
axis {
name 'GO_VERSION'
values '1.12.17', '1.16'
values '1.17.10', '1.18.2'
}
axis {
name 'PLATFORM'
Expand All @@ -49,7 +48,7 @@ pipeline {
exclude {
axis {
name 'GO_VERSION'
values '1.12.17'
values '1.17.10'
}
axis {
name 'PLATFORM'
Expand All @@ -59,7 +58,7 @@ pipeline {
exclude {
axis {
name 'GO_VERSION'
values '1.16'
values '1.18.2'
}
axis {
name 'PLATFORM'
Expand Down
4 changes: 1 addition & 3 deletions .ci/scripts/check_format.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ func main() {
paths = flag.Args()
}

goGet := exec.Command("go", "get", "-u", "golang.org/x/tools/cmd/goimports")
goGet.Env = os.Environ()
goGet.Env = append(goGet.Env, "GO111MODULE=off")
goGet := exec.Command("go", "install", "golang.org/x/tools/cmd/goimports@latest")
out, err := goGet.Output()
if err != nil {
log.Fatalf("failed to %v: %v", strings.Join(goGet.Args, " "), err)
Expand Down
4 changes: 1 addition & 3 deletions .ci/scripts/check_lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ func main() {
log.SetFlags(0)
flag.Parse()

goGet := exec.Command("go", "get", "-u", "golang.org/x/lint/golint")
goGet.Env = os.Environ()
goGet.Env = append(goGet.Env, "GO111MODULE=off")
goGet := exec.Command("go", "install", "golang.org/x/lint/golint@latest")
out, err := goGet.Output()
if err != nil {
log.Fatalf("failed to %v: %v", strings.Join(goGet.Args, " "), err)
Expand Down
6 changes: 2 additions & 4 deletions .ci/scripts/test.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
SET GO111MODULE=off
go get -u github.com/elastic/go-licenser
SET GO111MODULE=on
go install github.com/elastic/go-licenser@latest

go mod verify
go-licenser -d
Expand All @@ -11,5 +9,5 @@ mkdir -p build
SET OUT_FILE=build\output-report.out
go test "./..." -v > %OUT_FILE% | type %OUT_FILE%

go get -v -u github.com/jstemmer/go-junit-report
go install github.com/jstemmer/go-junit-report@latest
go-junit-report > build\junit-%GO_VERSION%.xml < %OUT_FILE%
4 changes: 2 additions & 2 deletions .ci/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euxo pipefail

GO111MODULE=off go get -u github.com/elastic/go-licenser
go install github.com/elastic/go-licenser@latest

go mod verify
go-licenser -d
Expand All @@ -14,7 +14,7 @@ export OUT_FILE="build/test-report.out"
mkdir -p build
go test "./..." -v 2>&1 | tee ${OUT_FILE}
status=$?
go get -v -u github.com/jstemmer/go-junit-report
go install github.com/jstemmer/go-junit-report@latest
go-junit-report > "build/junit-${GO_VERSION}.xml" < ${OUT_FILE}

exit ${status}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- Updated module to require Go 1.17. [#111](https://github.com/elastic/go-sysinfo/pull/111)

### Deprecated

### Removed
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ imports: $(GOPATH)/bin/goimports

$(GOPATH)/bin/go-licenser:
@echo "go-licenser missing, installing"
GO111MODULE=off go get -u github.com/elastic/go-licenser
go install github.com/elastic/go-licenser@latest

$(GOPATH)/bin/gofumpt:
@echo "gofumpt missing, installing"
Expand All @@ -26,4 +26,4 @@ $(GOPATH)/bin/gofumpt:

$(GOPATH)/bin/goimports:
@echo "goimports missing, installing"
GO111MODULE=off go get -u golang.org/x/tools/cmd/goimports
go install golang.org/x/tools/cmd/goimports@latest
7 changes: 6 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module github.com/elastic/go-sysinfo

go 1.17

require (
github.com/elastic/go-windows v1.0.0
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901
Expand All @@ -10,4 +12,7 @@ require (
howett.net/plist v0.0.0-20181124034731-591f970eefbb
)

go 1.13
require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
)
1 change: 1 addition & 0 deletions providers/aix/boottime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build aix
// +build aix

package aix
Expand Down
1 change: 1 addition & 0 deletions providers/aix/defs_aix.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build ignore
// +build ignore

package aix
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/arch_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build (amd64 && cgo) || (arm64 && cgo)
// +build amd64,cgo arm64,cgo

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/boottime_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build (amd64 && cgo) || (arm64 && cgo)
// +build amd64,cgo arm64,cgo

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/defs_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build ignore
// +build ignore

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/host_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build (amd64 && cgo) || (arm64 && cgo)
// +build amd64,cgo arm64,cgo

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/kernel_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build !386
// +build !386

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/machineid_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build (amd64 && cgo) || (arm64 && cgo)
// +build amd64,cgo arm64,cgo

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/memory_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build (amd64 && cgo) || (arm64 && cgo)
// +build amd64,cgo arm64,cgo

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/process_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build (amd64 && cgo) || (arm64 && cgo)
// +build amd64,cgo arm64,cgo

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/process_darwin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build (amd64 && cgo) || (arm64 && cgo)
// +build amd64,cgo arm64,cgo

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/darwin/syscall_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build (amd64 && cgo) || (arm64 && cgo)
// +build amd64,cgo arm64,cgo

package darwin
Expand Down
1 change: 1 addition & 0 deletions providers/linux/os_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
// specific language governing permissions and limitations
// under the License.

//go:build !windows
// +build !windows

package linux
Expand Down

0 comments on commit f2015f1

Please sign in to comment.