12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- package main
- import (
- "fmt"
- "git.giaever.org/joachimmg/go-ini.git/ini"
- )
- type Test struct {
- String string
- UnquotedString string
- MultipleLines string
- WithoutValue bool
- Int struct {
- Int int
- Int8 int8
- Int16 int16
- Int32 int32
- Int64 int64
- Uint struct {
- Uint uint
- Uint8 uint8
- Unint16 uint16
- Uint32 uint32
- Uint64 uint64
- }
- }
- }
- func main() {
- text := `
- String = "This is some text"
- UnquotedString = This is some unquoted text
- MultipleLines = This is \
- multiple lines \
- going on
- WithoutValue
- [int]
- Int = -1
- Int8 = -8
- Int16 = -16
- Int32 = -32
- Int64 = -64
- [int.uint]
- Uint = 1
- Uint8 = 8
- Uint16 = 16
- Uint32 = 32
- Uint64 = 64
- Uint64 = 64
- `
- fmt.Println("INI", text)
- test1 := Test{}
- test2 := Test{
- String: "This is some text",
- UnquotedString: "Helloooo... Not possible to not quote this",
- MultipleLines: "This is \nmultiple lines \ngoing on",
- WithoutValue: true,
- }
- //test2 := &Test{}
- ini.Unmarshal([]byte(text), test1)
- ini.Marshal(test2)
- }
|