Skip to content
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

all: add Go 1.14, deprecate Go 1.12 #2325

Merged
merged 6 commits into from
Feb 27, 2020
Merged

all: add Go 1.14, deprecate Go 1.12 #2325

merged 6 commits into from
Feb 27, 2020

Conversation

leighmcculloch
Copy link
Member

PR Checklist

PR Structure

  • This PR has reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR avoids mixing refactoring changes with feature changes (split into two PRs
    otherwise).
  • This PR's title starts with name of package that is most changed in the PR, ex.
    services/friendbot, or all or doc if the changes are broad or impact many
    packages.

Thoroughness

  • This PR adds tests for the most critical parts of the new functionality or fixes.
  • I've updated any docs (developer docs, .md
    files, etc... affected by this change). Take a look in the docs folder for a given service,
    like this one.

Release planning

  • I've updated the relevant CHANGELOG (here for Horizon) if
    needed with deprecations, added features, breaking changes, and DB schema changes.
  • I've decided if this PR requires a new major/minor version according to
    semver, or if it's mainly a patch change. The PR is targeted at the next
    release branch if it's not a patch change.

What

Add Go 1.14, deprecate Go 1.12.

Why

Go 1.14 was released yesterday. We support the last two versions of Go. With the release of 1.14, 1.12 becomes an unsupported version of Go and the Go team will no longer ship security patches to it.

For more information about the 1.14 release see:
https://groups.google.com/d/msg/golang-announce/AYd4cXYG8qk/FPTwU0jPCQAJ
https://golang.org/doc/go1.14

To find out more about the Go release cycle, see:
https://github.com/golang/go/wiki/Go-Release-Cycle

Known limitations

N/A

popd
)

printf "Running staticcheck...\n"

ls -d */ \
| egrep -v '^vendor|^docs' \
| xargs -I {} staticcheck -tests=false -checks="all,-ST1003,-SA1019,-ST1005,-ST1000,-ST1016" ./{}...
| xargs -I {} staticcheck -tests=false -checks="all,-ST1003,-SA1019,-ST1005,-ST1000,-ST1016,-S1039,-ST1021,-ST1020,-ST1019,-SA4022" ./{}...
Copy link
Member Author

@leighmcculloch leighmcculloch Feb 26, 2020

Choose a reason for hiding this comment

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

Upgrading staticcheck is required because the version of go/tools that staticcheck depends on had a bug fixed that is required for analyzing code with Go 1.14. These checks I'm adding here were added between the version of staticcheck we had and the one we're upgrading to. We have a ton of failures for most of them. It would be great to circle back and fix them, but it's out-of-scope for this PR.

To see what each of the checks mean, take a look at https://staticcheck.io/docs/checks.

Copy link
Member

Choose a reason for hiding this comment

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

@leighmcculloch
Copy link
Member Author

The latest golang:1.14 package hasn't been picked up by CircleCI yet. It'll probably be picked up over night or tomorrow and once that happens I'll rerun the build.

Copy link
Member

@ire-and-curses ire-and-curses left a comment

Choose a reason for hiding this comment

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

This is exciting! Thanks for picking up the new Go version so quickly!

@@ -1,4 +1,4 @@
FROM golang:1.12-stretch
FROM golang:1.14-stretch
Copy link
Member

Choose a reason for hiding this comment

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

Did we miss 1.13 before somehow?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. There were a few places we were still chugging 1.12. I can't see any particular reason for that. If anyone knows otherwise I'm all ears.

Comment on lines -140 to +148
assert.EqualError(t, err, "invalid URL or request: parse https:// there is something wrong here.com/stellar.toml: invalid character \" \" in host name")

urlErr, ok := errors.Cause(err).(*url.Error)
if !ok {
t.Fatalf("err expected to be a url.Error but was %#v", err)
}
assert.Equal(t, "parse", urlErr.Op)
assert.Equal(t, "https:// there is something wrong here.com/stellar.toml", urlErr.URL)
assert.EqualError(t, urlErr.Err, `invalid character " " in host name`)
Copy link
Member Author

@leighmcculloch leighmcculloch Feb 27, 2020

Choose a reason for hiding this comment

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

FYI @accordeiro I had to rewrite this spec you added recently to make it pass for both Go 1.13 and 1.14 because it turns out in 1.14 they changed the textual/string representation of URL parsing errors to place quotes (") around the invalid URL. For more details see:

Copy link
Member

Choose a reason for hiding this comment

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

Sounds great, thanks for addressing this! :)

@leighmcculloch leighmcculloch merged commit a7b48ae into stellar:master Feb 27, 2020
@leighmcculloch leighmcculloch deleted the go114 branch February 27, 2020 19:50
leighmcculloch added a commit that referenced this pull request Feb 29, 2020
### What
Update all CHANGELOG.md's mentioning that Go 1.12 support has been
dropped.

### Why
I dropped Go 1.12 support in #2325 but I overlooked adding a note to the
changelogs.
leighmcculloch added a commit that referenced this pull request Mar 3, 2020
### What
Use Go 1.14 for building in docker images.

### Why
We recently switched to building with Go 1.13 and 1.14 in #2325 and we should use the latest version for our builds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants