Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to fix modules' indirect depedencies on master #202

Merged
merged 4 commits into from
Mar 1, 2019

Conversation

jprobinson
Copy link
Contributor

If a server.SimpleService is built locally with our current master branch, the go.mod file looks like this:

require (
    github.com/NYTimes/gizmo v1.2.2-0.20190225181548-11877ba5aa85
    github.com/NYTimes/gziphandler v1.0.1 // indirect
    github.com/NYTimes/sqliface v0.0.0-20180310195202-f8e6c8b78d37 // indirect
    github.com/go-sql-driver/mysql v1.4.1 // indirect
    github.com/gorilla/websocket v1.4.0 // indirect
    golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 // indirect
)

I ended up blowing away the existing go.mod and go.sum in the base of the repo and rebuilding everything. With these changes, it's back to simply importing gizmo:

require github.com/NYTimes/gizmo v1.2.2-0.20190225192859-9d0764c8f4cd

I'm still yet to find the cause of the gopherjs packages popping up in our go.sum, but I'm starting to think it has something to do with a test framework used by one of our depedencies.

Unfortunately, despite our latest module changes, even building the simplest of simple servers still yields the same results when running go list as mentioned in #188. I'm open to suggestions if anyone has any.

If anyone is willing to take a shot, I'm using this server as my control during experiments:

func main() {
	server.Init("hello", nil)
	err := server.Register(&service{})
	if err != nil {
		log.Fatal(err)
	}
	err = server.Run()
	if err != nil {
		log.Fatal(err)
	}
}

type service struct{}

func (s *service) Prefix() string {
	return ""
}

func (s *service) Middleware(h http.Handler) http.Handler {
	return h
}

func (s *service) Endpoints() map[string]map[string]http.HandlerFunc {
	return map[string]map[string]http.HandlerFunc{
		"/": {
			"GET": hello,
		},
	}
}

func hello(w http.ResponseWriter, r *http.Request) {
	io.WriteString(w, "hello!")
}

@fsouza
Copy link
Contributor

fsouza commented Feb 25, 2019

go mod graph can help you track down why things are landing in go.sum.

@coveralls
Copy link

coveralls commented Feb 25, 2019

Coverage Status

Coverage remained the same at 51.665% when pulling ea3ee9a on more-module-cleanup into f435d7b on master.

@jprobinson
Copy link
Contributor Author

jprobinson commented Feb 25, 2019

From the graph output, it looks like gopherjs may be coming from github.com/smartystreets/goconvey, but it just says that Gizmo is indirectly using that.

go mod why shows up with:

╰─➤  go mod why github.com/smartystreets/goconvey/convey
# github.com/smartystreets/goconvey/convey
github.com/NYTimes/gizmo/config/aws
github.com/aws/aws-sdk-go/aws/credentials
github.com/go-ini/ini
github.com/go-ini/ini.test
github.com/smartystreets/goconvey/convey

Which led me to poking around the AWS libs but that appears to be a dead end. :(

@jprobinson jprobinson merged commit 2c5fa25 into master Mar 1, 2019
@jprobinson jprobinson deleted the more-module-cleanup branch March 1, 2019 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants