mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
build: run gofmt on all go source files
Go 1.19 will forecefully format all your doc strings. To get this out of the way, here is one big commit with all the changes gofmt wants to make.
This commit is contained in:
@@ -22,7 +22,6 @@ import (
|
||||
// basedir is used with file functions and allows a user to reference a file
|
||||
// using local path. Usually basedir is the directory in which the config file
|
||||
// is located
|
||||
//
|
||||
func Functions(basedir string, allowFS bool) map[string]function.Function {
|
||||
funcs := map[string]function.Function{
|
||||
"abs": stdlib.AbsoluteFunc,
|
||||
|
||||
@@ -341,9 +341,10 @@ func decodeTask(body hcl.Body, ctx *hcl.EvalContext, val interface{}) hcl.Diagno
|
||||
//
|
||||
// ```hcl
|
||||
// # block assignment
|
||||
// env {
|
||||
// ENV = "production"
|
||||
// }
|
||||
//
|
||||
// env {
|
||||
// ENV = "production"
|
||||
// }
|
||||
//
|
||||
// # as attribute
|
||||
// env = { ENV: "production" }
|
||||
@@ -357,7 +358,6 @@ func decodeTask(body hcl.Body, ctx *hcl.EvalContext, val interface{}) hcl.Diagno
|
||||
// found map, the remaining body and diagnostics. If the named field is found
|
||||
// with block syntax, it returns a nil map, and caller falls back to reading
|
||||
// with block syntax.
|
||||
//
|
||||
func decodeAsAttribute(body hcl.Body, ctx *hcl.EvalContext, name string) (map[string]string, hcl.Body, hcl.Diagnostics) {
|
||||
b, remain, diags := body.PartialContent(&hcl.BodySchema{
|
||||
Attributes: []hcl.AttributeSchema{
|
||||
|
||||
@@ -14,17 +14,21 @@ import (
|
||||
// More concretely, it changes the following:
|
||||
//
|
||||
// ```
|
||||
// config {
|
||||
// meta { ... }
|
||||
// }
|
||||
//
|
||||
// config {
|
||||
// meta { ... }
|
||||
// }
|
||||
//
|
||||
// ```
|
||||
//
|
||||
// to
|
||||
//
|
||||
// ```
|
||||
// config {
|
||||
// meta = { ... } # <- attribute now
|
||||
// }
|
||||
//
|
||||
// config {
|
||||
// meta = { ... } # <- attribute now
|
||||
// }
|
||||
//
|
||||
// ```
|
||||
func BlocksAsAttrs(body hcl.Body) hcl.Body {
|
||||
if hclb, ok := body.(*hcls.Body); ok {
|
||||
|
||||
@@ -1033,7 +1033,7 @@ func TestParseServiceCheck(t *testing.T) {
|
||||
|
||||
func TestWaitConfig(t *testing.T) {
|
||||
ci.Parallel(t)
|
||||
|
||||
|
||||
hclBytes, err := os.ReadFile("test-fixtures/template-wait-config.hcl")
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ func (v *Variable) GoString() string {
|
||||
|
||||
// validateValue ensures that all of the configured custom validations for a
|
||||
// variable value are passing.
|
||||
//
|
||||
func (v *Variable) validateValue(val VariableAssignment) (diags hcl.Diagnostics) {
|
||||
if len(v.Validations) == 0 {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user