Skip to content

Commit

Permalink
Migration: go 1.12
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreamacro committed Feb 26, 2019
1 parent 815e80f commit d75f9ff
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go
sudo: false
go:
- "1.11"
- '1.12'
install:
- "go mod download"
env:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ go get -u -v github.com/Dreamacro/clash

Pre-built binaries are available: [release](https://github.com/Dreamacro/clash/releases)

Requires Go >= 1.11.
Requires Go >= 1.12.

## Daemon

Expand Down
2 changes: 0 additions & 2 deletions adapters/outbound/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ func NewHttp(option HttpOption) *Http {
tlsConfig = &tls.Config{
InsecureSkipVerify: option.SkipCertVerify,
ClientSessionCache: getClientSessionCache(),
MinVersion: tls.VersionTLS11,
MaxVersion: tls.VersionTLS12,
ServerName: option.Server,
}
}
Expand Down
2 changes: 0 additions & 2 deletions adapters/outbound/socks5.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ func NewSocks5(option Socks5Option) *Socks5 {
tlsConfig = &tls.Config{
InsecureSkipVerify: option.SkipCertVerify,
ClientSessionCache: getClientSessionCache(),
MinVersion: tls.VersionTLS11,
MaxVersion: tls.VersionTLS12,
ServerName: option.Server,
}
}
Expand Down
13 changes: 3 additions & 10 deletions constant/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package constant

import (
"os"
"os/user"
P "path"
)

Expand All @@ -16,17 +15,11 @@ type path struct {
}

func init() {
currentUser, err := user.Current()
var homedir string
homedir, err := os.UserHomeDir()
if err != nil {
dir := os.Getenv("HOME")
if dir == "" {
dir, _ = os.Getwd()
}
homedir = dir
} else {
homedir = currentUser.HomeDir
homedir, _ = os.Getwd()
}

homedir = P.Join(homedir, ".config", Name)
Path = &path{homedir: homedir}
}
Expand Down
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ func init() {
}

func main() {
// enable tls 1.3 and remove when go 1.13
os.Setenv("GODEBUG", os.Getenv("GODEBUG")+",tls13=1")

if homedir != "" {
if !filepath.IsAbs(homedir) {
currentDir, _ := os.Getwd()
Expand Down

0 comments on commit d75f9ff

Please sign in to comment.