Skip to content

Commit 8bf8da1

Browse files
Michal Tichákknopers8
authored andcommitted
format everything with gofmt -s -w .
1 parent ebf112a commit 8bf8da1

File tree

103 files changed

+485
-469
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+485
-469
lines changed

apricot/cacheproxy/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func (s Service) GetDetectorsForHosts(hosts []string) ([]string, error) {
127127
detectors[det] = struct{}{}
128128
}
129129
detList := make([]string, 0, len(detectors))
130-
for det, _ := range detectors {
130+
for det := range detectors {
131131
detList = append(detList, det)
132132
}
133133
return detList, nil

apricot/local/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ func (s *Service) GetDetectorsForHosts(hosts []string) ([]string, error) {
385385

386386
detectorSlice := make([]string, len(detectorMap))
387387
i := 0
388-
for k, _ := range detectorMap {
388+
for k := range detectorMap {
389389
detectorSlice[i] = k
390390
i++
391391
}
@@ -548,7 +548,7 @@ func (s *Service) ListComponents() (components []string, err error) {
548548
}
549549
components = make([]string, len(componentSet))
550550
i := 0
551-
for component, _ := range componentSet {
551+
for component := range componentSet {
552552
components[i] = component
553553
i++
554554
}

apricot/local/servicehttp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ func (httpsvc *HttpService) ApiListComponentEntries(w http.ResponseWriter, r *ht
297297
filteredEntries := make([]string, 0)
298298
if hasRuntype { // if there's any filtering to do
299299
for _, entry := range entries {
300-
for filterPrefix, _ := range filterPrefixes {
300+
for filterPrefix := range filterPrefixes {
301301
if strings.HasPrefix(entry, filterPrefix) {
302302
filteredEntries = append(filteredEntries, entry)
303303
}

apricot/remote/client.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,8 @@ func newRpcClient(cxt context.Context, cancel context.CancelFunc, endpoint strin
4848

4949
client := &rpcClient{
5050
ApricotClient: apricotpb.NewApricotClient(conn),
51-
conn: conn,
51+
conn: conn,
5252
}
5353

5454
return client
5555
}
56-

cmd/coconut/main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@
2424

2525
package main
2626

27-
import(
27+
import (
2828
"github.com/AliceO2Group/Control/coconut/cmd"
29-
"github.com/teo/logrus-prefixed-formatter"
3029
log "github.com/sirupsen/logrus"
30+
"github.com/teo/logrus-prefixed-formatter"
3131
)
3232

3333
func init() {
3434
log.SetFormatter(&prefixed.TextFormatter{
35-
DisableTimestamp:true,
36-
FullTimestamp: true,
37-
SpacePadding: 20,
38-
PrefixPadding: 12,
35+
DisableTimestamp: true,
36+
FullTimestamp: true,
37+
SpacePadding: 20,
38+
PrefixPadding: 12,
3939

4040
// Needed for colored stdout/stderr in GoLand, IntelliJ, etc.
4141
ForceColors: true,
@@ -45,4 +45,4 @@ func init() {
4545

4646
func main() {
4747
cmd.Execute()
48-
}
48+
}

cmd/walnut/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
// Package walnut implements the O² Workflow Administration and Linting Utility.
2626
package main
2727

28-
2928
import "github.com/AliceO2Group/Control/walnut/cmd"
3029

3130
func main() {

coconut/app/constants.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ const (
2828
NAME = "coconut"
2929
PRETTY_SHORTNAME = "coconut"
3030
PRETTY_FULLNAME = "O² Control and Configuration Utility"
31-
)
31+
)

coconut/cmd/about.go

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@
2525
package cmd
2626

2727
import (
28+
"fmt"
2829
"github.com/AliceO2Group/Control/coconut/app"
30+
"github.com/fatih/color"
2931
"github.com/spf13/cobra"
30-
"fmt"
3132
"github.com/spf13/viper"
32-
"github.com/fatih/color"
3333
"time"
3434
)
3535

3636
// aboutCmd represents the about command
3737
var aboutCmd = &cobra.Command{
38-
Use: "about",
38+
Use: "about",
3939
Aliases: []string{},
40-
Short: fmt.Sprintf("about %s", app.NAME),
41-
Long: `The about command shows some basic information on this utility.`,
40+
Short: fmt.Sprintf("about %s", app.NAME),
41+
Long: `The about command shows some basic information on this utility.`,
4242
Run: func(*cobra.Command, []string) {
4343
color.Set(color.FgHiWhite)
4444
fmt.Print(app.PRETTY_SHORTNAME + " *** ")
@@ -52,15 +52,20 @@ endpoint: %s
5252
config_endpoint: %s
5353
`,
5454
color.HiGreenString(viper.GetString("version")),
55-
color.HiGreenString(func() string {if len(viper.ConfigFileUsed()) > 0 { return viper.ConfigFileUsed() }; return "builtin"}()),
55+
color.HiGreenString(func() string {
56+
if len(viper.ConfigFileUsed()) > 0 {
57+
return viper.ConfigFileUsed()
58+
}
59+
return "builtin"
60+
}()),
5661
color.HiGreenString(viper.GetString("endpoint")),
5762
color.HiGreenString(viper.GetString("config_endpoint")))
5863

5964
color.Set(color.FgHiBlue)
60-
fmt.Printf("\nCopyright 2017-%d CERN and the copyright holders of ALICE O².\n" +
61-
"This program is free software: you can redistribute it and/or modify \n" +
62-
"it under the terms of the GNU General Public License as published by \n" +
63-
"the Free Software Foundation, either version 3 of the License, or \n" +
65+
fmt.Printf("\nCopyright 2017-%d CERN and the copyright holders of ALICE O².\n"+
66+
"This program is free software: you can redistribute it and/or modify \n"+
67+
"it under the terms of the GNU General Public License as published by \n"+
68+
"the Free Software Foundation, either version 3 of the License, or \n"+
6469
"(at your option) any later version.\n", time.Now().Year())
6570
color.Unset()
6671

coconut/cmd/configuration.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import (
3030

3131
// configurationCmd represents the configuration command
3232
var configurationCmd = &cobra.Command{
33-
Use: "configuration",
33+
Use: "configuration",
3434
Aliases: []string{"config", "conf", "c"},
35-
Short: "view or modify O² configuration",
35+
Short: "view or modify O² configuration",
3636
Long: `The configuration command allows you to perform operations on the O²
3737
configuration store.`,
3838
}

coconut/cmd/configuration_dump.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ import (
3131

3232
// configurationDumpCmd represents the configuration list command
3333
var configurationDumpCmd = &cobra.Command{
34-
Use: "dump [key]",
34+
Use: "dump [key]",
3535
Aliases: []string{"d"},
36-
Short: "dump configuration subtree",
36+
Short: "dump configuration subtree",
3737
Long: `The configuration dump command requests from O² Configuration
3838
a subtree of key-values, and dumps it to standard output in the specified
3939
format. This command has full read access to the O² Configuration store
4040
and performs a raw query with no additional processing or access control
4141
semantics.`,
42-
Run: configuration.WrapCall(configuration.Dump),
43-
Args: cobra.ExactArgs(1),
42+
Run: configuration.WrapCall(configuration.Dump),
43+
Args: cobra.ExactArgs(1),
4444
}
4545

4646
func init() {

0 commit comments

Comments
 (0)