Skip to content

Commit

Permalink
Merge pull request #85 from maxmind/greg/support-go-1.10-again
Browse files Browse the repository at this point in the history
Support Go 1.10 again
  • Loading branch information
horgh authored Feb 21, 2020
2 parents 7f60ecf + 2594df1 commit bd3ac6a
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ os:
- windows

go:
- "1.10.x"
- "1.11.x"
- "1.12.x"
- "1.13.x"

before_script:
- |
if [[ $TRAVIS_GO_VERSION == '1.10.x' ]]; then
go get -t -u ./...
fi
- |
if [[ $TRAVIS_GO_VERSION == '1.13.x' && $TRAVIS_OS_NAME == 'linux' ]]; then
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# CHANGELOG

## 4.2.1 (2020-02-21)

* The minimum Go version is now 1.10 again as this was needed to build the PPA
packages.

## 4.2.0 (2020-02-20)

* The major version of the module is now included at the end of the module
Expand Down
2 changes: 2 additions & 0 deletions cmd/geoipupdate/version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build go1.12

package main

import "runtime/debug"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/maxmind/geoipupdate/v4

go 1.13
go 1.10

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
10 changes: 7 additions & 3 deletions pkg/geoipupdate/database/local_file_writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,14 @@ func (writer *LocalFileDatabaseWriter) Write(p []byte) (int, error) {

// Close closes the temporary file and releases the file lock.
func (writer *LocalFileDatabaseWriter) Close() error {
if err := writer.temporaryFile.Close(); err != nil && !errors.Is(err, os.ErrClosed) {
return errors.Wrap(err, "error closing temporary file")
err := writer.temporaryFile.Close()
if err != nil {
if perr, ok := err.(*os.PathError); !ok || perr.Err != os.ErrClosed {
return errors.Wrap(err, "error closing temporary file")
}
}
if err := os.Remove(writer.temporaryFile.Name()); err != nil && !errors.Is(err, os.ErrNotExist) {

if err := os.Remove(writer.temporaryFile.Name()); err != nil && !os.IsNotExist(err) {
return errors.Wrap(err, "error removing temporary file")
}
if err := writer.lock.Unlock(); err != nil {
Expand Down

0 comments on commit bd3ac6a

Please sign in to comment.