Skip to content

Commit

Permalink
all: Run Go 1.19 fmt (#217)
Browse files Browse the repository at this point in the history
To prevent issues with the latest `golangci-lint` in CI.
  • Loading branch information
bflad committed Aug 11, 2022
1 parent 83e0dc7 commit beb36ad
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 27 deletions.
7 changes: 3 additions & 4 deletions tfprotov5/internal/diag/diagnostics.go
Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions tfprotov5/internal/tf5serverlogging/downstream_request.go
Expand Up @@ -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(),
Expand Down
7 changes: 3 additions & 4 deletions tfprotov6/internal/diag/diagnostics.go
Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions tfprotov6/internal/tf6serverlogging/downstream_request.go
Expand Up @@ -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(),
Expand Down
18 changes: 7 additions & 11 deletions tftypes/value.go
Expand Up @@ -260,17 +260,13 @@ func (val Value) Copy() Value {
//
// The builtin Value representations are:
//
// * 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
// - 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
func NewValue(t Type, val interface{}) Value {
v, err := newValue(t, val)
if err != nil {
Expand Down

0 comments on commit beb36ad

Please sign in to comment.