Dumps information about a variable . The Same as PHP:var_dump
go get -v github.com/relunctance/dump
import (
"github.com/relunctance/dump"
)
func main(){
dump.Dump(
[]string{"a", "b", "c"},
"abc",
1,
1.68,
[]int{1, 2, 3, 4, 5},
[]int32{1, 2, 3, 4, 5},
map[string]string{
"a": "1",
"b": "2",
"c": "3",
},
map[string]int{
"a": 1,
"b": 2,
"c": 3,
},
)
}
/* returns:
[
"a",
"b",
"c"
]
"abc"
1
1.68
[
1,
2,
3,
4,
5
]
[
1,
2,
3,
4,
5
]
{
"a": "1",
"b": "2",
"c": "3"
}
{
"a": 1,
"b": 2,
"c": 3
}
*/
import (
"github.com/relunctance/dump"
"github.com/fatih/color"
)
func main(){
dump.ColorDump(
color.New(color.FgRed).Add(color.BgHiWhite), // with color
[]string{"a", "b", "c"},
"abc",
1,
1.68,
[]int{1, 2, 3, 4, 5},
[]int32{1, 2, 3, 4, 5},
map[string]string{ "a": "1", "b": "2", "c": "3", },
map[string]int{ "a": 1, "b": 2, "c": 3, },
)
}
import (
"github.com/relunctance/dump"
)
func main(){
dump.P(
[]string{"a", "b", "c"},
"abc",
1,
1.68,
[]int{1, 2, 3, 4, 5},
[]int32{1, 2, 3, 4, 5},
map[string]string{ "a": "1", "b": "2", "c": "3", },
map[string]int{ "a": 1, "b": 2, "c": 3, },
)
}