diff --git a/README.md b/README.md index 8be54fb..2794028 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Structure [![GoDoc](https://godoc.org/github.com/fatih/structure?status.png)](http://godoc.org/github.com/fatih/structure) [![Build Status](https://travis-ci.org/fatih/structure.png)](https://travis-ci.org/fatih/structure) +# Structure [![GoDoc](https://godoc.org/github.com/fatih/structure?status.svg)](http://godoc.org/github.com/fatih/structure) [![Build Status](https://travis-ci.org/fatih/structure.svg)](https://travis-ci.org/fatih/structure) Structure contains various utilitis to work with Go structs. @@ -8,7 +8,7 @@ Structure contains various utilitis to work with Go structs. go get github.com/fatih/structure ``` -## Examples +## Example ```go type Server struct { diff --git a/structure_test.go b/structure_test.go index 89e0dd5..a556da3 100644 --- a/structure_test.go +++ b/structure_test.go @@ -6,6 +6,16 @@ import ( "testing" ) +func TestToMapNonStruct(t *testing.T) { + foo := []string{"foo"} + + _, err := ToMap(foo) + if err == nil { + t.Error("ToMap shouldn't accept non struct types") + } + +} + func TestToMap(t *testing.T) { var T = struct { A string