Fix binary generation for builds (#89)

* Fix the binary building script for TravisCI builds
* Goimports code linting fixes
This commit is contained in:
Boyan Soubachov 2019-07-21 16:29:59 +02:00 committed by Pankaj Garg
parent 2f83ae6fb3
commit 82c8007bd9
3 changed files with 4 additions and 5 deletions

View file

@ -581,7 +581,7 @@ func runHTTPandHTTPSHandler(w http.ResponseWriter, r *http.Request, p EthrProtoc
http.Error(w, "Only GET, PUT and POST are supported.", http.StatusMethodNotAllowed)
return
}
if (testType == Bandwidth) {
if testType == Bandwidth {
if r.ContentLength > 0 {
atomic.AddUint64(&test.testResult.data, uint64(r.ContentLength))
}

View file

@ -212,7 +212,7 @@ func (u *serverTui) emitLatencyResults(remote, proto string, avg, min, max, p50,
func (u *serverTui) paint(seconds uint64) {
tm.Clear(tm.ColorDefault, tm.ColorDefault)
defer tm.Flush()
printCenterText(0, 0, u.w, "Ethr " + gVersion, tm.ColorBlack, tm.ColorWhite)
printCenterText(0, 0, u.w, "Ethr "+gVersion, tm.ColorBlack, tm.ColorWhite)
printHLineText(u.resX, u.resY-1, u.resW, "Test Results")
printHLineText(u.statX, u.statY-1, u.statW, "Statistics")
printVLine(u.topVSplitX, u.topVSplitY, u.topVSplitH)

3
travis_build.sh Normal file → Executable file
View file

@ -1,8 +1,7 @@
#!/bin/bash
echo $TRAVIS_OS_NAME
echo "${TRAVIS_OS_NAME}"
echo "${TRAVIS_GO_VERSION}"
if [ "${TRAVIS_OS_NAME}" = "linux" ] && [[ ${TRAVIS_GO_VERSION} == 1.11* ]]; then
if [ "${TRAVIS_OS_NAME}" = "linux" ]; then
export GOOS=windows
export GOARCH=amd64
go build -o windows/ethr.exe -ldflags "-X main.gVersion=$TRAVIS_TAG"