From e908832812e301451b0673bf3ecf828b04d727a5 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 10 Aug 2022 12:01:32 -0400 Subject: [PATCH 1/2] all: Run Go 1.19 fmt To prevent issues with the latest `golangci-lint` in CI. --- tfprotov5/internal/diag/diagnostics.go | 7 +++---- tfprotov5/internal/tf5serverlogging/downstream_request.go | 7 +++---- tfprotov6/internal/diag/diagnostics.go | 7 +++---- tfprotov6/internal/tf6serverlogging/downstream_request.go | 7 +++---- tftypes/value.go | 6 +++--- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/tfprotov5/internal/diag/diagnostics.go b/tfprotov5/internal/diag/diagnostics.go index 1032f7d4..9032b901 100644 --- a/tfprotov5/internal/diag/diagnostics.go +++ b/tfprotov5/internal/diag/diagnostics.go @@ -31,10 +31,9 @@ func (d Diagnostics) ErrorCount() int { // Log will log every diagnostic: // -// - Error severity at ERROR level -// - Warning severity at WARN level -// - Invalid/Unknown severity at WARN level -// +// - Error severity at ERROR level +// - Warning severity at WARN level +// - Invalid/Unknown severity at WARN level func (d Diagnostics) Log(ctx context.Context) { for _, diagnostic := range d { if diagnostic == nil { diff --git a/tfprotov5/internal/tf5serverlogging/downstream_request.go b/tfprotov5/internal/tf5serverlogging/downstream_request.go index eeec76e8..65ed7011 100644 --- a/tfprotov5/internal/tf5serverlogging/downstream_request.go +++ b/tfprotov5/internal/tf5serverlogging/downstream_request.go @@ -21,10 +21,9 @@ func DownstreamRequest(ctx context.Context) context.Context { // DownstreamResponse generates the following logging: // -// - TRACE "Received downstream response" log with request duration and -// diagnostic severity counts -// - Per-diagnostic logs -// +// - TRACE "Received downstream response" log with request duration and +// diagnostic severity counts +// - Per-diagnostic logs func DownstreamResponse(ctx context.Context, diagnostics diag.Diagnostics) { responseFields := map[string]interface{}{ logging.KeyDiagnosticErrorCount: diagnostics.ErrorCount(), diff --git a/tfprotov6/internal/diag/diagnostics.go b/tfprotov6/internal/diag/diagnostics.go index 543a3623..fbec5677 100644 --- a/tfprotov6/internal/diag/diagnostics.go +++ b/tfprotov6/internal/diag/diagnostics.go @@ -31,10 +31,9 @@ func (d Diagnostics) ErrorCount() int { // Log will log every diagnostic: // -// - Error severity at ERROR level -// - Warning severity at WARN level -// - Invalid/Unknown severity at WARN level -// +// - Error severity at ERROR level +// - Warning severity at WARN level +// - Invalid/Unknown severity at WARN level func (d Diagnostics) Log(ctx context.Context) { for _, diagnostic := range d { if diagnostic == nil { diff --git a/tfprotov6/internal/tf6serverlogging/downstream_request.go b/tfprotov6/internal/tf6serverlogging/downstream_request.go index c47df9b4..31ce386a 100644 --- a/tfprotov6/internal/tf6serverlogging/downstream_request.go +++ b/tfprotov6/internal/tf6serverlogging/downstream_request.go @@ -21,10 +21,9 @@ func DownstreamRequest(ctx context.Context) context.Context { // DownstreamResponse generates the following logging: // -// - TRACE "Received downstream response" log with request duration and -// diagnostic severity counts -// - Per-diagnostic logs -// +// - TRACE "Received downstream response" log with request duration and +// diagnostic severity counts +// - Per-diagnostic logs func DownstreamResponse(ctx context.Context, diagnostics diag.Diagnostics) { responseFields := map[string]interface{}{ logging.KeyDiagnosticErrorCount: diagnostics.ErrorCount(), diff --git a/tftypes/value.go b/tftypes/value.go index 4d7b7498..25bb24bd 100644 --- a/tftypes/value.go +++ b/tftypes/value.go @@ -262,9 +262,9 @@ func (val Value) Copy() Value { // // * String: string, *string // -// * Number: *big.Float, int64, *int64, int32, *int32, int16, *int16, int8, -// *int8, int, *int, uint64, *uint64, uint32, *uint32, uint16, -// *uint16, uint8, *uint8, uint, *uint, float64, *float64 +// - Number: *big.Float, int64, *int64, int32, *int32, int16, *int16, int8, +// *int8, int, *int, uint64, *uint64, uint32, *uint32, uint16, +// *uint16, uint8, *uint8, uint, *uint, float64, *float64 // // * Bool: bool, *bool // From 511b6b180d85951adecbb889dda4c261ee252c31 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 10 Aug 2022 12:03:59 -0400 Subject: [PATCH 2/2] tftypes: Additional Go documentation list tidying for NewValue() --- tftypes/value.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tftypes/value.go b/tftypes/value.go index 25bb24bd..f997347e 100644 --- a/tftypes/value.go +++ b/tftypes/value.go @@ -260,17 +260,13 @@ func (val Value) Copy() Value { // // The builtin Value representations are: // -// * String: string, *string -// +// - String: string, *string // - Number: *big.Float, int64, *int64, int32, *int32, int16, *int16, int8, // *int8, int, *int, uint64, *uint64, uint32, *uint32, uint16, // *uint16, uint8, *uint8, uint, *uint, float64, *float64 -// -// * Bool: bool, *bool -// -// * Map and Object: map[string]Value -// -// * Tuple, List, and Set: []Value +// - Bool: bool, *bool +// - Map and Object: map[string]Value +// - Tuple, List, and Set: []Value func NewValue(t Type, val interface{}) Value { v, err := newValue(t, val) if err != nil {