Update README.md

This commit is contained in:
Fatih Arslan 2014-07-27 17:01:33 +03:00
parent 9d01c85dab
commit 68345fdc8f

View File

@ -26,7 +26,9 @@ s := &Server{
} }
``` ```
Convert it to a `map[string]interface{}` #### ToMap()
Convert to a `map[string]interface{}`
```go ```go
m, err := structure.ToMap(s) m, err := structure.ToMap(s)
@ -38,6 +40,8 @@ if err != nil {
fmt.Printf("%#v", m) fmt.Printf("%#v", m)
``` ```
#### ToSlice()
Convert to a `[]interface{}`. Slice values are **sorted** by default according Convert to a `[]interface{}`. Slice values are **sorted** by default according
to the field names. to the field names.
@ -51,6 +55,8 @@ if err != nil {
fmt.Printf("%#v", m) fmt.Printf("%#v", m)
``` ```
#### IsStruct()
Check if it's a struct or a pointer to struct Check if it's a struct or a pointer to struct
```go ```go