Skip to content

Commit

Permalink
Set tomlNext from environment
Browse files Browse the repository at this point in the history
Mostly useful for CLI tools such as tomlv:

	% tomlv unicode.toml
	Error in 'unicode.toml': toml: line 3: expected '.' or '=', but got '€' instead

	% BURNTSUSHI_TOML_110=y tomlv unicode.toml
	(no output, ok!)
  • Loading branch information
arp242 committed Jan 21, 2023
1 parent 7edfd73 commit bd94408
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package toml

import (
"fmt"
"os"
"strconv"
"strings"
"time"
Expand All @@ -10,7 +11,10 @@ import (
"github.com/BurntSushi/toml/internal"
)

var tomlNext = false
var tomlNext = func() bool {
_, ok := os.LookupEnv("BURNTSUSHI_TOML_110")
return ok
}()

type parser struct {
lx *lexer
Expand Down

0 comments on commit bd94408

Please sign in to comment.