mirror of
https://github.com/Icinga/icingadb.git
synced 2026-04-24 07:41:06 -04:00
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.
This commit is contained in:
parent
ab42fab540
commit
9c2dcd2502
3 changed files with 24 additions and 24 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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{}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue