Code Monkey home page Code Monkey logo

Comments (6)

ysmood avatar ysmood commented on May 25, 2024

The code below works fine to me:

func TestLab(t *testing.T) {
	resp, err := http.Get("https://www.qq.com")
	if err != nil {
		log.Panic(err)
	}
	if err := gop.P(resp); err != nil {
		log.Panic(err)
	}
}

Even using the standard http lib, the output is huge to read, could you tell us why you want to print this kind of huge data structure?

from got.

liaohongxing avatar liaohongxing commented on May 25, 2024

打印这个结构可能无意义, 但我不小心把这段gop代码加入我的项目时。造成我的项目崩溃,这个最小案例是我真实项目截取出来的。我做了一番调查才发现是gop的问题 。我真实环境是用 _ = gop.P(resp)
我只是向你报告一下这个边缘案例。希望能调查造成这个的原因是什么,其他人打印别的这种类似结构体时。可能遇到崩溃问题。

from got.

ysmood avatar ysmood commented on May 25, 2024

了解了,我修复下

from got.

ysmood avatar ysmood commented on May 25, 2024

即使是 golang 都会报错,这里我们没有用 got,只用标准库函数都无法打印:

	a := map[interface{}]interface{}{}
	b := map[interface{}]interface{}{}
	a[&b] = b
	b[&a] = a

	fmt.Printf("%v", a)

from got.

liaohongxing avatar liaohongxing commented on May 25, 2024

那本质就是map循环引用导致无限循环是吧 。找出原因就行。

from got.

ysmood avatar ysmood commented on May 25, 2024

已经修正了呀,你没看懂 got 最新版不会有这个问题了吗

from got.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.