Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Commit

Permalink
Fix Travis CI (#74)
Browse files Browse the repository at this point in the history
* Fix some errors found by staticcheck

* Report but not fail for unused code
  • Loading branch information
fgsch committed Jan 27, 2019
1 parent 8e841b2 commit 24aa4c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ before_script:
script:
- dep ensure
- go vet
- staticcheck
- staticcheck -fail=-U1000
- golint -set_exit_status

deploy:
Expand Down
31 changes: 3 additions & 28 deletions waflyctl.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ var (
//logging variables
logFile string

//Trace level logging NOT USED
Trace *log.Logger

//Info level logging
Info *log.Logger

Expand All @@ -49,9 +46,6 @@ var (
// version number
version = "dev"
date = "unknown"

//HOMEDIRECTORY static variable
HOMEDIRECTORY string
)

// TOMLConfig is the applications config file
Expand Down Expand Up @@ -327,8 +321,6 @@ func Init(configFile string) TOMLConfig {

func getActiveVersion(client fastly.Client, serviceID, apiKey string, config TOMLConfig) int {

var activeVersion int

//get version list
apiCall := config.APIEndpoint + "/service/" + serviceID
resp, err := resty.R().
Expand All @@ -348,9 +340,8 @@ func getActiveVersion(client fastly.Client, serviceID, apiKey string, config TOM

//find the active version
for _, version := range body.Versions {
if version.Active == true {
activeVersion = version.Number
return activeVersion
if version.Active {
return version.Number
}
}

Expand Down Expand Up @@ -565,21 +556,6 @@ func FastlyLogging(client fastly.Client, serviceID string, version int, config T
return true
}

// FindCustomerID retrives a customerID using the Fastly API
func FindCustomerID(client fastly.Client, serviceID string) string {

//have client return the service Info
serviceInfo, err := client.GetService(&fastly.GetServiceInput{
ID: serviceID,
})
if err != nil {
Error.Printf("could not find a customer ID for service: %v", serviceID)
os.Exit(1)

}
return serviceInfo.CustomerID
}

func checkWAF(apiKey, apiEndpoint string) bool {
apiCall := apiEndpoint + "/verify"

Expand Down Expand Up @@ -2072,8 +2048,7 @@ func main() {
}

//run init to get our logging configured
var config TOMLConfig
config = Init(*configFile)
config := Init(*configFile)

config.APIEndpoint = *apiEndpoint

Expand Down

0 comments on commit 24aa4c1

Please sign in to comment.