Skip to content

Commit

Permalink
fixed the NetDialer syntax and updated the build script
Browse files Browse the repository at this point in the history
  • Loading branch information
DevoKun committed Apr 15, 2018
1 parent 823d325 commit 81301e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 2 additions & 4 deletions azhealthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,7 @@ fmt.Println(out.String())
netTransport = &http.Transport{
Dial: (&net.Dialer{
Timeout: 10 * time.Second,
DisableKeepAlives: true,
//KeepAlive: 10 * time.Second,
KeepAlive: 1 * time.Second,
}).Dial,
TLSClientConfig: tlsConfig, // used for the client ssl cert auth
TLSHandshakeTimeout: 10 * time.Second,
Expand All @@ -216,8 +215,7 @@ fmt.Println(out.String())
netTransport = &http.Transport{
Dial: (&net.Dialer{
Timeout: 10 * time.Second,
DisableKeepAlives: true,
//KeepAlive: 10 * time.Second,
KeepAlive: 1 * time.Second,
}).Dial,
TLSHandshakeTimeout: 10 * time.Second,
ResponseHeaderTimeout: 10 * time.Second,
Expand Down
8 changes: 6 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,19 @@ else
fi


TARGET_OPERATING_SYSTEMS="darwin linux" # windows
TARGET_OPERATING_SYSTEMS="darwin linux windows"
TARGET_PLATFORMS="amd64" # i386

for GOOS in $TARGET_OPERATING_SYSTEMS; do
for GOARCH in $TARGET_PLATFORMS; do
echo "Building $GOOS-$GOARCH"
export GOOS=$GOOS
export GOARCH=$GOARCH
go build -o target/${TARGET_FILENAME}-$GOOS-$GOARCH ${TARGET_FILENAME}.go
FINAL_FILENAME="target/${TARGET_FILENAME}-$GOOS-$GOARCH"
if [ $GOOS == "windows" ]; then
FINAL_FILENAME="${FINAL_FILENAME}.exe"
fi
go build -o $FINAL_FILENAME ${TARGET_FILENAME}.go
done
done

0 comments on commit 81301e9

Please sign in to comment.