Skip to content

Commit

Permalink
Fixes formatting directives
Browse files Browse the repository at this point in the history
  • Loading branch information
calvernaz authored and Luis Davim committed Sep 14, 2017
1 parent 2dd1358 commit 9adf62c
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions cliconfig/create_config.go
Expand Up @@ -57,7 +57,7 @@ func getDefaultFormatOption() string {
fmt.Println("Default output format (can be overridden via runtime flag)")
fmt.Println("1 - column")
fmt.Println("2 - json")
fmt.Println("3 - yaml\n")
fmt.Println("3 - yaml")
fmt.Printf("Option: ")

fmt.Scanf("%s", &response)
Expand Down Expand Up @@ -100,6 +100,6 @@ func getBoolAnswer(question string, defaultTrue bool) bool {
return false
}

fmt.Printf("\nERROR: Must response with 'y' or 'no'\n", response)
fmt.Printf("\nERROR: Must respond with 'y' or 'no'\n")
return getBoolAnswer(question, defaultTrue)
}
4 changes: 2 additions & 2 deletions cliconfig/create_environment.go
Expand Up @@ -44,7 +44,7 @@ func getPasswordWithVerify() string {
pass1 := getPassword("Password: ")
pass2 := getPassword("Verify Password: ")
if pass1 != pass2 {
fmt.Println("Password and Verify Password don't match\n")
fmt.Println("Password and Verify Password don't match")
return getPasswordWithVerify()
}
return pass1
Expand All @@ -54,7 +54,7 @@ func getTokenWithVerify() string {
token := getPassword("Token: ")
token2 := getPassword("Verify Token: ")
if token != token2 {
fmt.Println("Token and Verify Token don't match\n")
fmt.Println("Token and Verify Token don't match")
return getTokenWithVerify()
}
return token
Expand Down
4 changes: 2 additions & 2 deletions commands/config.go
Expand Up @@ -216,9 +216,9 @@ var configRootServiceCmd = &cobra.Command{
configFile.RootService = rootBool
configFile.Save()
if rootBool {
fmt.Println("\nService rooting is now enabled\n")
fmt.Println("\nService rooting is now enabled")
} else {
fmt.Println("\nService rooting is now disabled\n")
fmt.Println("\nService rooting is now disabled")
}
} else {
cli.Output(nil, ErrInvalidRootOption)
Expand Down
4 changes: 2 additions & 2 deletions commands/depcon.go
Expand Up @@ -87,7 +87,7 @@ func Execute() {
rootCmd.Execute()
return
}
logger.Logger().Error("%s file not found. Generating initial configuration", file.Filename())
logger.Logger().Errorf("%s file not found. Generating initial configuration", file.Filename())
configFile = cliconfig.CreateNewConfigFromUserInput()
}
}
Expand Down Expand Up @@ -123,7 +123,7 @@ func executeWithExistingConfig() {
os.Exit(1)
}
if _, err := configFile.GetEnvironment(envName); err != nil {
logger.Logger().Error("'%s' environment could not be found in config (%s)\n\n", envName, configFile.Filename())
logger.Logger().Errorf("'%s' environment could not be found in config (%s)\n\n", envName, configFile.Filename())
printValidEnvironments()
os.Exit(1)
} else {
Expand Down
4 changes: 2 additions & 2 deletions commands/format.go
Expand Up @@ -36,7 +36,7 @@ func getFormatType() string {
}

func PrintError(err error) {
log.Error("%v", err.Error())
log.Errorf("%v", err.Error())
os.Exit(1)
}

Expand All @@ -60,6 +60,6 @@ func printEncodedType(formatter cli.Formatter, encoder encoding.EncoderType) {
func printColumn(formatter cli.Formatter) {
err := formatter.ToColumns(os.Stdout)
if err != nil {
log.Error("Error: %s", err.Error())
log.Errorf("Error: %s", err.Error())
}
}
4 changes: 2 additions & 2 deletions compose/logfactory.go
Expand Up @@ -13,11 +13,11 @@ type ComposeLogger struct {
}

func (n *ComposeLogger) Out(b []byte) {
log.Info("%v", b)
log.Infof("%v", b)
}

func (n *ComposeLogger) Err(b []byte) {
log.Error("%v", b)
log.Errorf("%v", b)
}

func (n *ComposeLogger) ErrWriter() io.Writer {
Expand Down
2 changes: 1 addition & 1 deletion marathon/application_test.go
Expand Up @@ -21,7 +21,7 @@ func TestCreateApplicationFromFile(t *testing.T) {
c := MarathonClient{}
app, err := c.ParseApplicationFromFile(AppsFolder+"app_params.json", opts)
if err != nil {
log.Panic("Expected success %v", err)
log.Panicf("Expected success %v", err)
}
log.Debug("%v", app)
if app.Labels["tags"] != "prom-metrics" {
Expand Down
6 changes: 3 additions & 3 deletions marathon/event.go
Expand Up @@ -51,10 +51,10 @@ func (c *MarathonClient) setupSSEStream() error {
select {
case ev := <-stream.Events:
if err := c.handleStreamEvent(ev.Data()); err != nil {
log.Error("Error setting up SSE Stream: %v", err)
log.Errorf("Error setting up SSE Stream: %v", err)
}
case err := <-stream.Errors:
log.Error("Error setting up SSE Stream: %v", err)
log.Errorf("Error setting up SSE Stream: %v", err)
}
}
}()
Expand All @@ -78,7 +78,7 @@ func (c *MarathonClient) handleStreamEvent(data string) error {
}

if err := encoding.DefaultJSONEncoder().UnMarshalStr(data, event.Event); err != nil {
return fmt.Errorf("Failed to decode event, id: %s, error: %s", event.ID, err)
return fmt.Errorf("Failed to decode event, id: %d, error: %s", event.ID, err)
}

if event.ID&c.eventStreamState.filter != 0 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/output.go
Expand Up @@ -84,7 +84,7 @@ func buildFuncMap(userFuncs template.FuncMap) template.FuncMap {
}

func durationToMilliseconds(t time.Duration) string {
return fmt.Sprintf("%d ms", (t.Nanoseconds() / int64(time.Millisecond)))
return fmt.Sprintf("%d ms", t.Nanoseconds()/int64(time.Millisecond))
}

func padString(s string) string {
Expand Down
2 changes: 1 addition & 1 deletion pkg/httpclient/client.go
Expand Up @@ -81,7 +81,7 @@ func NewHttpClient(config HttpClientConfig) *HttpClient {
hc := &HttpClient{
config: config,
http: &http.Client{
Timeout: (time.Duration(config.RequestTimeout) * time.Second),
Timeout: time.Duration(config.RequestTimeout) * time.Second,
},
}
if config.TLSInsecureSkipVerify {
Expand Down

0 comments on commit 9adf62c

Please sign in to comment.