From 9c2dcd2502b7effb3c88950fbb3e7fc24defb76d Mon Sep 17 00:00:00 2001 From: Julian Brost Date: Fri, 4 Aug 2023 12:48:18 +0200 Subject: [PATCH] Run `go fmt ./...` Looks like newer Go version have a different opinion on how indentation in comments should look like. Adapt existing comments to make the GitHub Actions happy. --- pkg/icingadb/v1/environment.go | 8 ++++---- pkg/utils/utils.go | 32 ++++++++++++++++---------------- pkg/version/version.go | 8 ++++---- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pkg/icingadb/v1/environment.go b/pkg/icingadb/v1/environment.go index fdddc5bee..80e06f6aa 100644 --- a/pkg/icingadb/v1/environment.go +++ b/pkg/icingadb/v1/environment.go @@ -22,10 +22,10 @@ func (e *Environment) Meta() *EnvironmentMeta { // EnvironmentFromContext returns the Environment value stored in ctx, if any: // -// e, ok := EnvironmentFromContext(ctx) -// if !ok { -// // Error handling. -// } +// e, ok := EnvironmentFromContext(ctx) +// if !ok { +// // Error handling. +// } func EnvironmentFromContext(ctx context.Context) (*Environment, bool) { if e, ok := ctx.Value(environmentContextKey).(*Environment); ok { return e, true diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 8ccf29b33..4b0fe1df0 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -55,12 +55,12 @@ func Key(name string, sep byte) string { // // Timed should be installed by defer: // -// func TimedExample(logger *zap.SugaredLogger) { -// defer utils.Timed(time.Now(), func(elapsed time.Duration) { -// logger.Debugf("Executed job in %s", elapsed) -// }) -// job() -// } +// func TimedExample(logger *zap.SugaredLogger) { +// defer utils.Timed(time.Now(), func(elapsed time.Duration) { +// logger.Debugf("Executed job in %s", elapsed) +// }) +// job() +// } func Timed(start time.Time, callback func(elapsed time.Duration)) { callback(time.Since(start)) } @@ -158,20 +158,20 @@ func Ellipsize(s string, limit int) string { // // Example usage: // -// # snake_case -// ConvertCamelCase(s, unicode.Lower, '_') +// # snake_case +// ConvertCamelCase(s, unicode.Lower, '_') // -// # SCREAMING_SNAKE_CASE -// ConvertCamelCase(s, unicode.Upper, '_') +// # SCREAMING_SNAKE_CASE +// ConvertCamelCase(s, unicode.Upper, '_') // -// # kebab-case -// ConvertCamelCase(s, unicode.Lower, '-') +// # kebab-case +// ConvertCamelCase(s, unicode.Lower, '-') // -// # SCREAMING-KEBAB-CASE -// ConvertCamelCase(s, unicode.Upper, '-') +// # SCREAMING-KEBAB-CASE +// ConvertCamelCase(s, unicode.Upper, '-') // -// # other.separator -// ConvertCamelCase(s, unicode.Lower, '.') +// # other.separator +// ConvertCamelCase(s, unicode.Lower, '.') func ConvertCamelCase(s string, _case int, sep byte) string { r := []rune(s) b := strings.Builder{} diff --git a/pkg/version/version.go b/pkg/version/version.go index 5135fdcb0..250318c7e 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -17,14 +17,14 @@ type VersionInfo struct { } // Version determines version and commit information based on multiple data sources: -// - Version information dynamically added by `git archive` in the remaining to parameters. -// - A hardcoded version number passed as first parameter. -// - Commit information added to the binary by `go build`. +// - Version information dynamically added by `git archive` in the remaining to parameters. +// - A hardcoded version number passed as first parameter. +// - Commit information added to the binary by `go build`. // // It's supposed to be called like this in combination with setting the `export-subst` attribute for the corresponding // file in .gitattributes: // -// var Version = version.Version("1.0.0-rc2", "$Format:%(describe)$", "$Format:%H$") +// var Version = version.Version("1.0.0-rc2", "$Format:%(describe)$", "$Format:%H$") // // When exported using `git archive`, the placeholders are replaced in the file and this version information is // preferred. Otherwise the hardcoded version is used and augmented with commit information from the build metadata.