fix module declaration and remove toml dependency (#178)
This commit is contained in:
@@ -1,5 +1,3 @@
|
|||||||
module github.com/natefinch/lumberjack
|
module gopkg.in/natefinch/lumberjack.v2
|
||||||
|
|
||||||
require github.com/BurntSushi/toml v0.3.1
|
|
||||||
|
|
||||||
go 1.13
|
go 1.13
|
||||||
|
|||||||
@@ -1,2 +0,0 @@
|
|||||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/BurntSushi/toml"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// !!!NOTE!!!
|
// !!!NOTE!!!
|
||||||
@@ -709,27 +707,6 @@ func TestJson(t *testing.T) {
|
|||||||
equals(true, l.Compress, t)
|
equals(true, l.Compress, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestToml(t *testing.T) {
|
|
||||||
data := `
|
|
||||||
filename = "foo"
|
|
||||||
maxsize = 5
|
|
||||||
maxage = 10
|
|
||||||
maxbackups = 3
|
|
||||||
localtime = true
|
|
||||||
compress = true`[1:]
|
|
||||||
|
|
||||||
l := Logger{}
|
|
||||||
md, err := toml.Decode(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)
|
|
||||||
equals(0, len(md.Undecoded()), t)
|
|
||||||
}
|
|
||||||
|
|
||||||
// makeTempDir creates a file with a semi-unique name in the OS temp directory.
|
// makeTempDir creates a file with a semi-unique name in the OS temp directory.
|
||||||
// It should be based on the name of the test, to keep parallel tests from
|
// It should be based on the name of the test, to keep parallel tests from
|
||||||
// colliding, and must be cleaned up after the test is finished.
|
// colliding, and must be cleaned up after the test is finished.
|
||||||
|
|||||||
Reference in New Issue
Block a user