-
Notifications
You must be signed in to change notification settings - Fork 1
Cleaned up Go code directory structure #99
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
Conversation
no goreleaser changes required? changing the package name didn't affect the executable name? |
I don't think so.
The final segment of the package name is also still "observe-agent", so no change needed there. And the "github.com..." stuff is of course never part of the executable name. goreleaser eventually fails with these kind of errors:
but I read that's normal for local builds outside of GitHub CI, and it happens after the executables are built successfully. |
internal/commands/version/version.go
Outdated
@@ -19,12 +19,12 @@ var versionCmd = &cobra.Command{ | |||
is based on the package release.`, | |||
Run: func(cmd *cobra.Command, args []string) { | |||
version := getVersion() | |||
fmt.Printf("observe-agent version: %s\n", version) | |||
fmt.Printf("github.com/observeinc/observe-agent version: %s\n", version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think this also doesn't need the prefix
Moved cmd/collector to observecol, because the cmd subdirectory is reserved for packages that are executables, while our observe-agent executable is actually defined by the root directory of the repo. Renamed/moved directory cmd to internal. All of the packages under the former cmd directory are really internal packages, not executables. Changed the module name of the observe-agent module from "observe-agent" to "github.com/observeinc/observe-agent". Changed the module name of the observecol module (the one generated by ocb) from "observecol" to "github.com/observeinc/observe-agent/observecol". Ran `go mod tidy` in all our modules (including observek8sattributesprocessor) and sorted out all the replacement and versioning issues. Everything is squeaky clean now. Updated a bunch of dependencies as a byproduct of `go mod tidy`. build-ocb now also works under Linux (after setting the OCB variable in the Makefile correctly).
Regarding go.sum: I removed the go.sum files in this commit because I was going crazy trying to resolve the merge conflicts over and over again. Most people on the interwebs recommend checking the file in, even if it tends to create a lot of merge conflicts, because other people can use it to verify that their local dependencies really match what the author of the library used. I'm happy to bring back the go.sum files, but I recommend doing a separate PR to keep this one lean. |
Description
OB-37278: Clean up Go code directory structure