Skip to content

Commit 5dff542

Browse files
committed
all: fix linter errors
Change-Id: I0e4f29eae3c4490dc733e5d04a35e9ad61144077
1 parent 2a4181f commit 5dff542

File tree

10 files changed

+31
-30
lines changed

10 files changed

+31
-30
lines changed

cfgstruct/bind.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var (
4040
}
4141
)
4242

43-
// BindOpt is an option for the Bind method
43+
// BindOpt is an option for the Bind method.
4444
type BindOpt struct {
4545
isDev *bool
4646
isSetup *bool
@@ -73,7 +73,7 @@ func SetupMode() BindOpt {
7373
// UseDevDefaults forces the bind call to use development defaults unless
7474
// UseReleaseDefaults is provided as a subsequent option.
7575
// Without either, Bind will default to determining which defaults to use
76-
// based on version.Build.Release
76+
// based on version.Build.Release.
7777
func UseDevDefaults() BindOpt {
7878
dev := true
7979
return BindOpt{isDev: &dev}
@@ -82,7 +82,7 @@ func UseDevDefaults() BindOpt {
8282
// UseReleaseDefaults forces the bind call to use release defaults unless
8383
// UseDevDefaults is provided as a subsequent option.
8484
// Without either, Bind will default to determining which defaults to use
85-
// based on version.Build.Release
85+
// based on version.Build.Release.
8686
func UseReleaseDefaults() BindOpt {
8787
dev := false
8888
return BindOpt{isDev: &dev}
@@ -367,22 +367,22 @@ func expand(vars map[string]string, val string) string {
367367
return os.Expand(val, func(key string) string { return vars[key] })
368368
}
369369

370-
// FindConfigDirParam returns '--config-dir' param from os.Args (if exists)
370+
// FindConfigDirParam returns '--config-dir' param from os.Args (if exists).
371371
func FindConfigDirParam() string {
372372
return FindFlagEarly("config-dir")
373373
}
374374

375-
// FindIdentityDirParam returns '--identity-dir' param from os.Args (if exists)
375+
// FindIdentityDirParam returns '--identity-dir' param from os.Args (if exists).
376376
func FindIdentityDirParam() string {
377377
return FindFlagEarly("identity-dir")
378378
}
379379

380-
// FindDefaultsParam returns '--defaults' param from os.Args (if it exists)
380+
// FindDefaultsParam returns '--defaults' param from os.Args (if it exists).
381381
func FindDefaultsParam() string {
382382
return FindFlagEarly("defaults")
383383
}
384384

385-
// FindFlagEarly retrieves the value of a flag before `flag.Parse` has been called
385+
// FindFlagEarly retrieves the value of a flag before `flag.Parse` has been called.
386386
func FindFlagEarly(flagName string) string {
387387
// workaround to have early access to 'dir' param
388388
for i, arg := range os.Args {
@@ -395,7 +395,7 @@ func FindFlagEarly(flagName string) string {
395395
return ""
396396
}
397397

398-
// SetupFlag sets up flags that are needed before `flag.Parse` has been called
398+
// SetupFlag sets up flags that are needed before `flag.Parse` has been called.
399399
func SetupFlag(log *zap.Logger, cmd *cobra.Command, dest *string, name, value, usage string) {
400400
if foundValue := FindFlagEarly(name); foundValue != "" {
401401
value = foundValue
@@ -406,7 +406,7 @@ func SetupFlag(log *zap.Logger, cmd *cobra.Command, dest *string, name, value, u
406406
}
407407
}
408408

409-
// DefaultsType returns the type of defaults (release/dev) this binary should use
409+
// DefaultsType returns the type of defaults (release/dev) this binary should use.
410410
func DefaultsType() string {
411411
// define a flag so that the flag parsing system will be happy.
412412
defaults := strings.ToLower(FindDefaultsParam())
@@ -420,7 +420,7 @@ func DefaultsType() string {
420420
}
421421

422422
// DefaultsFlag sets up the defaults=dev/release flag options, which is needed
423-
// before `flag.Parse` has been called
423+
// before `flag.Parse` has been called.
424424
func DefaultsFlag(cmd *cobra.Command) BindOpt {
425425
// define a flag so that the flag parsing system will be happy.
426426
defaults := DefaultsType()

cfgstruct/flags.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/spf13/pflag"
1010
)
1111

12-
// FlagSet is an interface that matches *pflag.FlagSet
12+
// FlagSet is an interface that matches *pflag.FlagSet.
1313
type FlagSet interface {
1414
BoolVar(p *bool, name string, value bool, usage string)
1515
IntVar(p *int, name string, value int, usage string)

debug/panel.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ var buttonsTemplate = template.Must(template.New("").Parse(`<!DOCTYPE html>
148148
</body>
149149
</html>`))
150150

151-
// slugify converts text to a slug
151+
// slugify converts text to a slug.
152152
func slugify(s string) string {
153153
return strings.Map(func(r rune) rune {
154154
switch {
@@ -164,7 +164,7 @@ func slugify(s string) string {
164164
}, s)
165165
}
166166

167-
// Cycle returns button group for a cycle
167+
// Cycle returns button group for a cycle.
168168
func Cycle(name string, cycle *sync2.Cycle) *ButtonGroup {
169169
return &ButtonGroup{
170170
Name: name,

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ require (
2525
google.golang.org/grpc v1.27.1
2626
gopkg.in/yaml.v2 v2.2.4
2727
storj.io/common v0.0.0-20200424175742-65ac59022f4f
28+
storj.io/drpc v0.0.11
2829
storj.io/monkit-jaeger v0.0.0-20200518165323-80778fc3f91b
2930
)

process/exec.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func init() {
2626
}
2727
}
2828

29-
// check if file exists, handle error correctly if it doesn't
29+
// fileExists checks whether file exists, handle error correctly if it doesn't.
3030
func fileExists(path string) bool {
3131
_, err := os.Stat(path)
3232
if err != nil {

process/exec_conf.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func ExecWithCustomConfig(cmd *cobra.Command, debugEnabled bool, loadConfig func
9292
}
9393
}
9494

95-
// Ctx returns the appropriate context.Context for ExecuteWithConfig commands
95+
// Ctx returns the appropriate context.Context for ExecuteWithConfig commands.
9696
func Ctx(cmd *cobra.Command) (context.Context, context.CancelFunc) {
9797
commandMtx.Lock()
9898
defer commandMtx.Unlock()
@@ -122,7 +122,7 @@ func Ctx(cmd *cobra.Command) (context.Context, context.CancelFunc) {
122122
return ctx, cancel
123123
}
124124

125-
// AtomicLevel returns the appropriate zap.AtomicLevel for ExecuteWithConfig commands
125+
// AtomicLevel returns the appropriate zap.AtomicLevel for ExecuteWithConfig commands.
126126
func AtomicLevel(cmd *cobra.Command) *zap.AtomicLevel {
127127
commandMtx.Lock()
128128
defer commandMtx.Unlock()

process/logging.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func NewLoggerWithOutputPaths(outputPaths ...string) (*zap.Logger, error) {
5757
}
5858

5959
// NewLoggerWithOutputPathsAndAtomicLevel is the same as NewLoggerWithOutputPaths, but overrides the log output paths
60-
// and returns the AtomicLevel
60+
// and returns the AtomicLevel.
6161
func NewLoggerWithOutputPathsAndAtomicLevel(outputPaths ...string) (*zap.Logger, *zap.AtomicLevel, error) {
6262
levelEncoder := zapcore.CapitalLevelEncoder
6363
timeKey := "T"

traces/traces.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ import (
1616
)
1717

1818
var (
19-
// TagDB tags a trace as hitting the database
19+
// TagDB tags a trace as hitting the database.
2020
TagDB = tracetagger.NewTagRef()
2121
)
2222

23-
// CollectTraces starts storing all known tagged traces on disk, until cancel
24-
// is called
23+
// CollectTraces starts storing all known tagged traces on disk,
24+
// until cancel is called.
2525
func CollectTraces() (cancel func()) {
2626
path := filepath.Join(os.TempDir(), "storj-traces", fmt.Sprint(os.Getpid()))
2727
disable := TagDB.Enable()
@@ -43,12 +43,12 @@ func CollectTraces() (cancel func()) {
4343
}
4444
}
4545

46-
// Tag tags a trace with the given tag
46+
// Tag tags a trace with the given tag.
4747
func Tag(ctx context.Context, tag *tracetagger.TagRef) {
4848
tracetagger.Tag(ctx, tag)
4949
}
5050

51-
// TagScope tags all functions on an entire monkit Scope with a given tag
51+
// TagScope tags all functions on an entire monkit Scope with a given tag.
5252
func TagScope(tag *tracetagger.TagRef, scope *monkit.Scope) {
5353
tracetagger.TagScope(tag, scope)
5454
}

version/stats.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"github.com/spacemonkeygo/monkit/v3"
1111
)
1212

13-
// Stats implements the monkit.StatSource interface
13+
// Stats implements the monkit.StatSource interface.
1414
func (info *Info) Stats(cb func(key monkit.SeriesKey, field string, val float64)) {
1515
key := monkit.NewSeriesKey("version_info")
1616

version/version.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ var (
3030
VerError = errs.Class("version error")
3131

3232
// the following fields are set by linker flags. if any of them
33-
// are set and fail to parse, the program will fail to start
33+
// are set and fail to parse, the program will fail to start.
3434
buildTimestamp string // unix seconds since epoch
3535
buildCommitHash string
3636
buildVersion string // semantic version format
3737
buildRelease string // true/false
3838

39-
// Build is a struct containing all relevant build information associated with the binary
39+
// Build is a struct containing all relevant build information associated with the binary.
4040
Build Info
4141
)
4242

43-
// Info is the versioning information for a binary
43+
// Info is the versioning information for a binary.
4444
type Info struct {
4545
// sync/atomic cache
4646
commitHashCRC uint32
@@ -52,7 +52,7 @@ type Info struct {
5252
}
5353

5454
// SemVer represents a semantic version.
55-
// TODO: replace with semver.Version
55+
// TODO: replace with semver.Version.
5656
type SemVer struct {
5757
semver.Version
5858
}
@@ -165,7 +165,7 @@ func (sem *SemVer) Compare(version SemVer) int {
165165
return sem.Version.Compare(version.Version)
166166
}
167167

168-
// String converts the SemVer struct to a more easy to handle string
168+
// String converts the SemVer struct to a more easy to handle string.
169169
func (sem *SemVer) String() (version string) {
170170
return fmt.Sprintf("v%d.%d.%d", sem.Major, sem.Minor, sem.Patch)
171171
}
@@ -184,7 +184,7 @@ func (ver *Version) SemVer() (SemVer, error) {
184184
return NewSemVer(ver.Version)
185185
}
186186

187-
// New creates Version_Info from a json byte array
187+
// New creates Version_Info from a json byte array.
188188
func New(data []byte) (v Info, err error) {
189189
err = json.Unmarshal(data, &v)
190190
return v, VerError.Wrap(err)
@@ -195,7 +195,7 @@ func (info Info) IsZero() bool {
195195
return reflect.ValueOf(info).IsZero()
196196
}
197197

198-
// Marshal converts the existing Version Info to any json byte array
198+
// Marshal converts the existing Version Info to any json byte array.
199199
func (info Info) Marshal() ([]byte, error) {
200200
data, err := json.Marshal(info)
201201
if err != nil {

0 commit comments

Comments
 (0)