From 74c008f3d2dcb9c295248aada067301a0d810932 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Sat, 22 Oct 2022 10:23:34 +0200 Subject: [PATCH] Test Go 1.19; gofmt 1.19 --- .github/workflows/test.yml | 2 +- encode.go | 16 ++++++------- error.go | 46 +++++++++++++++++++------------------- lex.go | 2 +- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0e8de097..89361528 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,7 +5,7 @@ "test": { "strategy": { "matrix": { - "go-version": ["1.13.x", "1.14.x", "1.15.x", "1.16.x", "1.17.x", "1.18.x"], + "go-version": ["1.13.x", "1.14.x", "1.15.x", "1.16.x", "1.17.x", "1.18.x", "1.19.x"], "os": ["ubuntu-latest", "macos-latest", "windows-latest"] } }, diff --git a/encode.go b/encode.go index 3ff37cfb..930e1d52 100644 --- a/encode.go +++ b/encode.go @@ -99,9 +99,9 @@ type Marshaler interface { // struct field name will be used. If the "omitempty" option is present the // following value will be skipped: // -// - arrays, slices, maps, and string with len of 0 -// - struct with all zero values -// - bool false +// - arrays, slices, maps, and string with len of 0 +// - struct with all zero values +// - bool false // // If omitzero is given all int and float types with a value of 0 will be // skipped. @@ -683,15 +683,15 @@ func (enc *Encoder) newline() { // Write a key/value pair: // -// key = +// key = // // This is also used for "k = v" in inline tables; so something like this will // be written in three calls: // -// ┌───────────────────┐ -// │ ┌───┐ ┌────┐│ -// v v v v vv -// key = {k = 1, k2 = 2} +// ┌───────────────────┐ +// │ ┌───┐ ┌────┐│ +// v v v v vv +// key = {k = 1, k2 = 2} func (enc *Encoder) writeKeyValue(key Key, val reflect.Value, inline bool) { if len(key) == 0 { encPanic(errNoKey) diff --git a/error.go b/error.go index ed07f9c9..f4f390e6 100644 --- a/error.go +++ b/error.go @@ -11,44 +11,44 @@ import ( // In addition to the error message itself, you can also print detailed location // information with context by using [ErrorWithPosition]: // -// toml: error: Key 'fruit' was already created and cannot be used as an array. +// toml: error: Key 'fruit' was already created and cannot be used as an array. // -// At line 4, column 2-7: +// At line 4, column 2-7: // -// 2 | fruit = [] -// 3 | -// 4 | [[fruit]] # Not allowed -// ^^^^^ +// 2 | fruit = [] +// 3 | +// 4 | [[fruit]] # Not allowed +// ^^^^^ // // [ErrorWithUsage] can be used to print the above with some more detailed usage // guidance: // -// toml: error: newlines not allowed within inline tables +// toml: error: newlines not allowed within inline tables // -// At line 1, column 18: +// At line 1, column 18: // -// 1 | x = [{ key = 42 # -// ^ +// 1 | x = [{ key = 42 # +// ^ // -// Error help: +// Error help: // -// Inline tables must always be on a single line: +// Inline tables must always be on a single line: // -// table = {key = 42, second = 43} +// table = {key = 42, second = 43} // -// It is invalid to split them over multiple lines like so: +// It is invalid to split them over multiple lines like so: // -// # INVALID -// table = { -// key = 42, -// second = 43 -// } +// # INVALID +// table = { +// key = 42, +// second = 43 +// } // -// Use regular for this: +// Use regular for this: // -// [table] -// key = 42 -// second = 43 +// [table] +// key = 42 +// second = 43 type ParseError struct { Message string // Short technical message. Usage string // Longer message with usage guidance; may be blank. diff --git a/lex.go b/lex.go index 28ed4dd3..d4d70871 100644 --- a/lex.go +++ b/lex.go @@ -771,7 +771,7 @@ func lexRawString(lx *lexer) stateFn { } // lexMultilineRawString consumes a raw string. Nothing can be escaped in such -// a string. It assumes that the beginning "'''" has already been consumed and +// a string. It assumes that the beginning ''' has already been consumed and // ignored. func lexMultilineRawString(lx *lexer) stateFn { r := lx.next()