Skip to content

Commit

Permalink
Drop support for versions of Go prior to 1.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
axw committed Jan 12, 2022
1 parent 06e3549 commit b78e1b6
Show file tree
Hide file tree
Showing 122 changed files with 165 additions and 1,254 deletions.
8 changes: 1 addition & 7 deletions .jenkins.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
GO_VERSION:
- stable
- "1.x"
- "1.8.x"
- "1.9.x"
- "1.10.x"
- "1.11.x"
- "1.12.x"
- "1.13.x"
- "1.14.x"
- "1.15.x"
- "1.16.x"
- "1.17.x"
8 changes: 0 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ pipeline {
deleteDir()
unstash 'source'
dir("${BASE_DIR}"){
sh script: './scripts/jenkins/before_install.sh', label: 'Install dependencies'
sh script: './scripts/jenkins/docker-test.sh', label: 'Docker tests'
}
}
Expand Down Expand Up @@ -150,7 +149,6 @@ pipeline {
deleteDir()
unstash 'source'
dir("${BASE_DIR}"){
sh script: './scripts/jenkins/before_install.sh', label: 'Install dependencies'
sh script: './scripts/jenkins/bench.sh', label: 'Benchmarking'
sendBenchmarks(file: 'build/bench.out', index: 'benchmark-go')
}
Expand Down Expand Up @@ -200,9 +198,6 @@ pipeline {
retry(3) {
deleteDir()
unstash 'source'
dir("${BASE_DIR}"){
sh script: './scripts/jenkins/before_install.sh', label: 'Install dependencies'
}
}
retry(3) {
dir("${BASE_DIR}"){
Expand Down Expand Up @@ -297,9 +292,6 @@ def generateStep(version){
retry(3) {
deleteDir()
unstash 'source'
dir("${BASE_DIR}"){
sh script: './scripts/jenkins/before_install.sh', label: 'Install dependencies'
}
}
retry(3) {
dir("${BASE_DIR}"){
Expand Down
19 changes: 5 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,37 +8,28 @@ check: precheck check-modules test
precheck: check-goimports check-lint check-vanity-import check-vet check-dockerfile-testing check-licenses model/marshal_fastjson.go scripts/Dockerfile-testing

.PHONY: check-goimports
.PHONY: check-dockerfile-testing
.PHONY: check-lint
.PHONY: check-licenses
.PHONY: check-modules
.PHONY: check-vanity-import
ifeq ($(shell go run ./scripts/mingoversion.go -print 1.12),true)
check-goimports:
sh scripts/check_goimports.sh

.PHONY: check-dockerfile-testing
check-dockerfile-testing:
go run ./scripts/gendockerfile.go -d

.PHONY: check-lint
check-lint:
sh scripts/check_lint.sh

.PHONY: check-licenses
check-licenses:
go run github.com/elastic/go-licenser -d $(patsubst %,-exclude %,$(GO_LICENSER_EXCLUDE)) .

.PHONY: check-modules
check-modules:
go run scripts/genmod/main.go -check .

.PHONY: check-vanity-import
check-vanity-import:
sh scripts/check_vanity.sh
else
check-goimports:
check-dockerfile-testing:
check-lint:
check-licenses:
check-modules:
check-vanity-import:
endif

.PHONY: check-vet
check-vet:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ go get -u go.elastic.co/apm

## Requirements

Tested with Go 1.8+ on Linux, Windows and MacOS.
Tested with Go 1.15+ on Linux, Windows and MacOS.

Requires [APM Server](https://github.com/elastic/apm-server) v6.5 or newer.

Expand Down
6 changes: 3 additions & 3 deletions apmtest/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (
"bytes"
"fmt"
"io"
"math"
"sort"
"text/tabwriter"
"time"
"unicode/utf8"

"go.elastic.co/apm/internal/apmmath"
"go.elastic.co/apm/model"
)

Expand Down Expand Up @@ -81,13 +81,13 @@ func WriteTraceWaterfall(w io.Writer, tx model.Transaction, spans []model.Span)
})

for _, span := range spans {
pos := int(apmmath.Round(
pos := int(math.Round(
float64(time.Time(span.Timestamp).Sub(time.Time(tx.Timestamp))) /
float64(maxDuration) * float64(maxWidth),
))
tDur := time.Duration(span.Duration * float64(time.Millisecond))
dur := float64(tDur) / float64(maxDuration)
width := int(apmmath.Round(dur * float64(maxWidth)))
width := int(math.Round(dur * float64(maxWidth)))
if width == int(maxWidth) {
width = int(maxWidth) - 1
}
Expand Down
3 changes: 0 additions & 3 deletions breakdown_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build go1.14
// +build go1.14

package apm

import (
Expand Down
48 changes: 0 additions & 48 deletions error_go113_test.go

This file was deleted.

16 changes: 16 additions & 0 deletions error_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,22 @@ func TestErrorCauseCycle(t *testing.T) {
assert.Equal(t, "errorslice", payloads.Errors[0].Exception.Cause[0].Cause[0].Message)
}

func TestErrorCauseUnwrap(t *testing.T) {
err := fmt.Errorf("%w", errors.New("cause"))

tracer, recorder := transporttest.NewRecorderTracer()
defer tracer.Close()
tracer.NewError(err).Send()
tracer.Flush(nil)

payloads := recorder.Payloads()
require.Len(t, payloads.Errors, 1)
assert.Equal(t, "TestErrorCauseUnwrap", payloads.Errors[0].Culprit)

require.Len(t, payloads.Errors[0].Exception.Cause, 1)
assert.Equal(t, "cause", payloads.Errors[0].Exception.Cause[0].Message)
}

func assertErrorTransactionSampled(t *testing.T, e model.Error, sampled bool) {
assert.Equal(t, &sampled, e.Transaction.Sampled)
if sampled {
Expand Down
3 changes: 0 additions & 3 deletions internal/apmgodog/suitecontext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build go1.13
// +build go1.13

package apmgodog_test

import (
Expand Down
3 changes: 0 additions & 3 deletions internal/apmgodog/testmain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
// specific language governing permissions and limitations
// under the License.

//go:build go1.13
// +build go1.13

package apmgodog_test

import (
Expand Down
28 changes: 0 additions & 28 deletions internal/apmmath/round_go10.go

This file was deleted.

34 changes: 0 additions & 34 deletions internal/apmmath/round_go9.go

This file was deleted.

38 changes: 0 additions & 38 deletions internal/apmstrings/concat10.go

This file was deleted.

60 changes: 0 additions & 60 deletions internal/apmstrings/concat10_test.go

This file was deleted.

Loading

0 comments on commit b78e1b6

Please sign in to comment.