Adding fmt target to Makefile
Change-Id: I595fdee85dd34e401e8b4fa13215a86131b4c068
diff --git a/Makefile b/Makefile
index e46cc27..319710f 100644
--- a/Makefile
+++ b/Makefile
@@ -31,13 +31,16 @@
dep: # @HELP Download the dependencies to the vendor folder
GO111MODULE=on go mod vendor
-build: dep protos build-bbsim build-bbsimctl# @HELP Build the binary
+build: fmt dep protos build-bbsim build-bbsimctl# @HELP Build the binary
-test: dep protos # @HELP Execute unit tests
+test: fmt dep protos # @HELP Execute unit tests
GO111MODULE=on go test -v -mod vendor ./... -covermode count -coverprofile ./tests/results/go-test-coverage.out 2>&1 | tee ./tests/results/go-test-results.out
go-junit-report < ./tests/results/go-test-results.out > ./tests/results/go-test-results.xml
gocover-cobertura < ./tests/results/go-test-coverage.out > ./tests/results/go-test-coverage.xml
+fmt:
+ go fmt ./...
+
docker-build: # @HELP Build a docker container
docker build -t ${DOCKER_REGISTRY}${DOCKER_REPOSITORY}bbsim:${DOCKER_TAG} -f build/package/Dockerfile .
diff --git a/internal/bbsimctl/config/config.go b/internal/bbsimctl/config/config.go
index caf0601..7d11122 100644
--- a/internal/bbsimctl/config/config.go
+++ b/internal/bbsimctl/config/config.go
@@ -18,27 +18,27 @@
package config
import (
+ "fmt"
log "github.com/sirupsen/logrus"
+ "gopkg.in/yaml.v2"
"io/ioutil"
"net"
"os"
- "fmt"
"time"
- "gopkg.in/yaml.v2"
)
var (
- Version string
- BuildTime string
- CommitHash string
- GitStatus string
+ Version string
+ BuildTime string
+ CommitHash string
+ GitStatus string
)
var GlobalOptions struct {
- Config string `short:"c" long:"config" env:"BBSIMCTL_CONFIG" value-name:"FILE" default:"" description:"Location of client config file"`
- Server string `short:"s" long:"server" default:"" value-name:"SERVER:PORT" description:"IP/Host and port of XOS"`
+ Config string `short:"c" long:"config" env:"BBSIMCTL_CONFIG" value-name:"FILE" default:"" description:"Location of client config file"`
+ Server string `short:"s" long:"server" default:"" value-name:"SERVER:PORT" description:"IP/Host and port of XOS"`
//Protoset string `long:"protoset" value-name:"FILENAME" description:"Load protobuf definitions from protoset instead of reflection api"`
- Debug bool `short:"d" long:"debug" description:"Enable debug mode"`
+ Debug bool `short:"d" long:"debug" description:"Enable debug mode"`
}
type GrpcConfigSpec struct {
@@ -46,8 +46,8 @@
}
type GlobalConfigSpec struct {
- Server string `yaml:"server"`
- Grpc GrpcConfigSpec
+ Server string `yaml:"server"`
+ Grpc GrpcConfigSpec
}
var GlobalConfig = GlobalConfigSpec{
@@ -90,7 +90,6 @@
GlobalConfig.Server = GlobalOptions.Server
}
-
// Generate error messages for required settings
if GlobalConfig.Server == "" {
log.Fatal("Server is not set. Please update config file or use the -s option")
@@ -102,4 +101,4 @@
GlobalConfig.Server = net.JoinHostPort(addrs[0], port)
}
}
-}
\ No newline at end of file
+}