Skip to content

Commit

Permalink
fix: odd indentation in README
Browse files Browse the repository at this point in the history
  • Loading branch information
rdbo authored Jan 30, 2024
1 parent 05bedf3 commit 0203a8b
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ Given the following struct, let's see how to read it and write it as TOML:

```go
type MyConfig struct {
Version int
Name string
Tags []string
Version int
Name string
Tags []string
}
```

Expand All @@ -119,7 +119,7 @@ tags = ["go", "toml"]
var cfg MyConfig
err := toml.Unmarshal([]byte(doc), &cfg)
if err != nil {
panic(err)
panic(err)
}
fmt.Println("version:", cfg.Version)
fmt.Println("name:", cfg.Name)
Expand All @@ -140,14 +140,14 @@ as a TOML document:

```go
cfg := MyConfig{
Version: 2,
Name: "go-toml",
Tags: []string{"go", "toml"},
Version: 2,
Name: "go-toml",
Tags: []string{"go", "toml"},
}

b, err := toml.Marshal(cfg)
if err != nil {
panic(err)
panic(err)
}
fmt.Println(string(b))

Expand Down Expand Up @@ -293,16 +293,16 @@ element in the interface to decode the object. For example:

```go
type inner struct {
B interface{}
B interface{}
}
type doc struct {
A interface{}
A interface{}
}

d := doc{
A: inner{
B: "Before",
},
A: inner{
B: "Before",
},
}

data := `
Expand Down Expand Up @@ -341,7 +341,7 @@ contained in the doc is superior to the capacity of the array. For example:

```go
type doc struct {
A [2]string
A [2]string
}
d := doc{}
err := toml.Unmarshal([]byte(`A = ["one", "two", "many"]`), &d)
Expand Down

0 comments on commit 0203a8b

Please sign in to comment.