Git Product home page Git Product logo

Comments (6)

wu-sheng avatar wu-sheng commented on July 21, 2024

Which library has a bug? go2sky or 3rd party?

from go2sky.

xuzq3 avatar xuzq3 commented on July 21, 2024

Which library has a bug? go2sky or 3rd party?

go2sky/plugins/gin/gin.go

from go2sky.

wu-sheng avatar wu-sheng commented on July 21, 2024

Could you try to submit a pull request to fix it?

from go2sky.

arugal avatar arugal commented on July 21, 2024

Hi @xuzq3 can you provide your code, I can't reproduce this bug :)

from go2sky.

xuzq3 avatar xuzq3 commented on July 21, 2024

go2sky/plugins/gin/gin.go

m.routeMapOnce.Do(func() {
	routes := engine.Routes()
	rm := make(map[string]map[string]routeInfo)
	for _, r := range routes {
		mm := rm[r.Method]
		if mm == nil {
			mm = make(map[string]routeInfo)
			rm[r.Method] = mm
		}
		mm[r.Handler] = routeInfo{
			operationName: c.Request.Host + c.Request.URL.Path,same
		}
		m.routeMap = rm
	}
})

Because of sync.Once, routeMap is initialized by gin.Context of the first request. And it will never change. When the url of the next request is different, operationName is wrong.

from go2sky.

arugal avatar arugal commented on July 21, 2024

haha @xuzq3 are you interested in fixing it :)

from go2sky.

Related Issues (20)

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.