Skip to content

Commit

Permalink
Go 1.10.2 -> 1.10.3. Remove support for Go < 1.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
aaron42net committed Jul 13, 2018
1 parent 7a14f44 commit ea5ca91
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 38 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -5,14 +5,14 @@ language: go

matrix:
include:
- go: 1.6.4
env: VIPS_VERSION=8.4.6
- go: 1.7.6
env: VIPS_VERSION=8.4.6
- go: 1.8.7
env: VIPS_VERSION=8.5.9
- go: 1.9.4
- go: 1.9.7
env: VIPS_VERSION=8.5.9
- go: 1.10.3
env: VIPS_VERSION=8.5.9 GOLINT=true

before_install:
- rm -rf $GOPATH/{bin,pkg}/*
Expand Down
2 changes: 1 addition & 1 deletion cmd/fotomat/version.go
Expand Up @@ -8,7 +8,7 @@ import (

const (
// FotomatVersion is updated by git-hooks/pre-commit
FotomatVersion = "2.8.231"
FotomatVersion = "2.8.232"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion preinstall.sh
Expand Up @@ -8,7 +8,7 @@ set -euo pipefail
# Usage: sudo ./preinstall.sh

VIPS_VERSION=${VIPS_VERSION:-8.5.9}
GO_VERSION=${GO_VERSION:-1.10.2}
GO_VERSION=${GO_VERSION:-1.10.3}

export PATH="/usr/local/bin:/usr/bin:/bin:${PATH:-}"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
Expand Down
12 changes: 1 addition & 11 deletions thumbnail/proxy.go
Expand Up @@ -6,7 +6,6 @@ import (
"io/ioutil"
"net"
"net/http"
"net/url"
"strconv"
"time"
)
Expand Down Expand Up @@ -211,17 +210,8 @@ func isTimeout(err error) bool {
if err == nil {
return false
}
switch err := err.(type) {
case net.Error:
if err, ok := err.(net.Error); ok {
return err.Timeout()
case *url.Error:
// Only necessary for Go < 1.6.
if err, ok := err.Err.(net.Error); ok {
return err.Timeout()
}
if err.Err.Error() == "net/http: request canceled while waiting for connection" {
return true
}
}
return false
}
8 changes: 8 additions & 0 deletions thumbnail/proxy_test.go
Expand Up @@ -55,6 +55,14 @@ func TestProxyErrors(t *testing.T) {
assert.Nil(t, NewProxy(nil, nil, 0, nil))
}

func TestProxyTimeout(t *testing.T) {
ps := newProxyServer(time.Second, time.Nanosecond)
defer ps.close()

body, status := ps.get("timeout")
assert.Equal(t, http.StatusGatewayTimeout, status, string(body))
}

type proxyServer struct {
proxy *Proxy
server *httptest.Server
Expand Down
22 changes: 0 additions & 22 deletions thumbnail/timeout_test.go

This file was deleted.

0 comments on commit ea5ca91

Please sign in to comment.