Skip to content

Commit

Permalink
Remove dependency on gopkg.in/yaml.v2 (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhita authored Jan 19, 2023
1 parent 47ffae2 commit 215739b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 29 deletions.
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module github.com/natefinch/lumberjack

require (
github.com/BurntSushi/toml v0.3.1
gopkg.in/yaml.v2 v2.2.2
)
require github.com/BurntSushi/toml v0.3.1

go 1.13
4 changes: 0 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
21 changes: 0 additions & 21 deletions lumberjack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"time"

"github.com/BurntSushi/toml"
"gopkg.in/yaml.v2"
)

// !!!NOTE!!!
Expand Down Expand Up @@ -710,26 +709,6 @@ func TestJson(t *testing.T) {
equals(true, l.Compress, t)
}

func TestYaml(t *testing.T) {
data := []byte(`
filename: foo
maxsize: 5
maxage: 10
maxbackups: 3
localtime: true
compress: true`[1:])

l := Logger{}
err := yaml.Unmarshal(data, &l)
isNil(err, t)
equals("foo", l.Filename, t)
equals(5, l.MaxSize, t)
equals(10, l.MaxAge, t)
equals(3, l.MaxBackups, t)
equals(true, l.LocalTime, t)
equals(true, l.Compress, t)
}

func TestToml(t *testing.T) {
data := `
filename = "foo"
Expand Down

0 comments on commit 215739b

Please sign in to comment.