1 Star 0 Fork 0

lorock / goutil

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 907 Bytes
一键复制 编辑 原始数据 按行查看 历史
lorock 提交于 2020-09-26 20:45 . A: goaddr

Dump

This is an print debug vars util package.

Install

go get gitee.com/lorock/goutil/dump

Usage

run demo: go run ./dump/_examples/demo1.go

package main

import "gitee.com/lorock/goutil/dump"

// rum demo: go run ./dump/_examples/demo1.go
func main() {
	otherFunc1()
}

func otherFunc1() {
	dump.P(
		23,
		[]string{"ab", "cd"},
		[]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}, // len > 10
		map[string]interface{}{
			"key": "val", "sub": map[string]string{"k": "v"},
		},
		struct {
			ab string
			Cd int
		}{
			"ab", 23,
		},
	)
}

You will see:

More preview

  • nested struct

Functions

func P(vs ...interface{})
func V(vs ...interface{})
func Print(vs ...interface{})
1
https://gitee.com/lorock/goutil.git
git@gitee.com:lorock/goutil.git
lorock
goutil
goutil
master

搜索帮助