This repository was archived by the owner on Dec 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
stellar/go module: deprecation comments for rename to go-stellar-sdk #2
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,41 +1,11 @@ | ||
| # How to contribute | ||
|
|
||
| 👍🎉 First off, thanks for taking the time to contribute! 🎉👍 | ||
|
|
||
| Check out the [Stellar Contribution Guide](https://github.com/stellar/.github/blob/master/CONTRIBUTING.md) that apply to all Stellar projects. | ||
|
|
||
| ## Style guides | ||
|
|
||
| ### Git Commit Messages | ||
| # ⚠️ REPOSITORY DEPRECATED ⚠️ | ||
|
|
||
| * Use the present tense ("Add feature" not "Added feature") | ||
| * Use the imperative mood ("Move cursor to..." not "Moves cursor to...") | ||
| **This repository has been moved to: [github.com/stellar/go-stellar-sdk](https://github.com/stellar/go-stellar-sdk)** | ||
|
|
||
| ### Issues | ||
| All new development will take place there. | ||
|
|
||
| * Issues and PR titles start with: | ||
| * The package name most affected, ex. `ingest: fix...`. | ||
| * Or, multiple package names separated by a comma when the fix addresses multiple packages worth noting, ex. `ingest, processors: fix...`. | ||
| * Or, `all:` when changes or an issue are broad, ex. `all: update...`. | ||
| * Or, `doc:` when changes or an issue are isolated to non-code documentation not limited to a single package. | ||
| * Label issues with `bug` if they're clearly a bug. | ||
| * Label issues with `feature request` if they're a feature request. | ||
| **Migration Guide:** See [MIGRATION.md](MIGRATION.md) for detailed instructions. | ||
|
|
||
| ### Pull Requests | ||
|
|
||
| * PR titles follow the same rules as described in the [Issues](#Issues) section above. | ||
| * PRs must update the [CHANGELOG](CHANGELOG.md) with a small description of the change | ||
| * PRs are merged into master or release branch using squash merge | ||
| * Carefully think about where your PR fits according to [semver](https://semver.org). Target it at master if it’s only a patch change, otherwise if it contains breaking change or significant feature additions, set the base branch to the next major or minor release. | ||
| * Keep PR scope narrow. Expectation: 20 minutes to review max | ||
| * Explicitly differentiate refactoring PRs and feature PRs. Refactoring PRs don’t change functionality. They usually touch a lot more code, and are reviewed in less detail. Avoid refactoring in feature PRs. | ||
|
|
||
| ### Go Style Guide | ||
|
|
||
| * Use `gofmt` or preferably `goimports` to format code | ||
| * Follow [Effective Go](https://golang.org/doc/effective_go.html) and [Go Code Review Comments](https://github.com/golang/go/wiki/CodeReviewComments) | ||
|
|
||
| ### Go Coding conventions | ||
| # How to contribute | ||
|
|
||
| - Always document exported package elements: vars, consts, funcs, types, etc. | ||
| - Tests are better than no tests. | ||
| Refer to [github.com/stellar/go-stellar-sdk](https://github.com/stellar/go-stellar-sdk) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,108 +1,8 @@ | ||
| # Developing | ||
| # ⚠️ REPOSITORY DEPRECATED ⚠️ | ||
|
|
||
| Welcome to the Stellar Go monorepo. These instructions help launch 🚀 you into making and testing code changes to this repository. | ||
| **This repository has been moved to: [github.com/stellar/go-stellar-sdk](https://github.com/stellar/go-stellar-sdk)** | ||
|
|
||
| For details about what's in this repository and how it is organized read the [README.md](README.md). | ||
| All new development will take place there. | ||
|
|
||
| If you're aiming to submit a contribution make sure to also read the [contributing guidelines](CONTRIBUTING.md). | ||
| **Migration Guide:** See [MIGRATION.md](MIGRATION.md) for detailed instructions. | ||
|
|
||
| ## Requirements | ||
| To checkout, build, and run most tests these tools are required: | ||
| - Git | ||
| - [Go](https://golang.org/dl) | ||
|
|
||
| To run some tests these tools are also required: | ||
| - PostgreSQL 12+ server running locally, or set [environment variables](https://www.postgresql.org/docs/12/libpq-envars.html) (e.g. `PGHOST`, etc) for alternative host. | ||
| - MySQL 10.1+ server running locally. | ||
|
|
||
| ## Get the code | ||
|
|
||
| Check the code out anywhere, using a `GOPATH` is not required. | ||
|
|
||
| ``` | ||
| git clone https://github.com/stellar/go | ||
| ``` | ||
|
|
||
| ## Running tests | ||
|
|
||
| ``` | ||
| go test ./... | ||
| ``` | ||
|
|
||
| ## Running tools | ||
|
|
||
| ``` | ||
| go run ./tools/<tool> | ||
| ``` | ||
|
|
||
| ## Managing dependencies | ||
|
|
||
| * Supported on the two latest major Go releases | ||
| * Uses [Go Modules](https://github.com/golang/go/wiki/Modules) for dependency management (see [go.mod](./go.mod)) | ||
| * Standard go build, go test, and go run workflows apply | ||
|
|
||
| ### Adding/Removing dependencies | ||
|
|
||
| Add new dependencies by adding the import paths to the code. The next time you execute a Go command the tool will update the `go.mod` and `go.sum` files. | ||
|
|
||
| To add a specific version of a dependency use `go get`: | ||
|
|
||
| ``` | ||
| go get <importpath>@<version> | ||
| ``` | ||
|
|
||
| Before opening a PR make sure to run following command to tidy the module file. It will keep the go.* files tidy: | ||
| - `go mod tidy` | ||
|
|
||
| ### Updating a dependency | ||
|
|
||
| Update an existing dependency by using `go get`: | ||
|
|
||
| ``` | ||
| go get <importpath>@<version> | ||
| ``` | ||
| Before opening a PR make sure to run these commands to tidy the module files: | ||
| ``` | ||
| go mod tidy | ||
| ``` | ||
|
|
||
| Note: `go list -m all` may show that the dependency is still being used. It will be possible that the dependency is still an indirect dependency. If it's important to understand why the dependency is still being used, use `go mod why <importpath>/...` and `go mod graph | grep <importpath>` to understand which modules are importing it. | ||
|
|
||
| ### Reviewing changes in dependencies | ||
|
|
||
| When updating or adding dependencies it's critical that we review what the | ||
| changes are in those dependencies that we are introducing into our builds. When | ||
| dependencies change the diff for the `go.mod` file may be complex to | ||
| understand. In that situation check each new or upgraded dependency, | ||
| and check each dependencies code diffs to see what is being imported. | ||
| Always treat code being imported as code written that needs review. | ||
|
|
||
| ``` | ||
| git checkout master | ||
| go list -m -json all > go.list.master | ||
| git checkout <branch> | ||
| golistcmp go.list.master <(go list -m -json all) | ||
| ``` | ||
|
|
||
| ## Package source layout | ||
|
|
||
| While much of the code in individual packages is organized based upon different developers' personal preferences, many of the packages follow a simple convention for organizing the declarations inside of a package that aim to aid in your ability to find code. | ||
|
|
||
| In each package, there may be one or more of a set of common files: | ||
|
|
||
| - *errors.go*: This file should contains declarations (both types and vars) for errors that are used by the package. | ||
| - *example_test.go*: This file should contains example tests, as described at https://blog.golang.org/examples. | ||
| - *main.go/internal.go* (**deprecated**): Older packages may have a `main.go` (public symbols) or `internal.go` (private symbols). These files contain, respectively, the exported and unexported vars, consts, types and funcs for the package. New packages do not follow this pattern, and instead follow the standard Go convention to co-locate structs and their methods in the same files. | ||
| - *main.go* (**new convention**): If present, this file contains a `main` function as part of an executable `main` package. | ||
|
|
||
| In addition to the above files, a package often has files that contains code that is specific to one declared type. This file uses the snake case form of the type name (for example `loggly_hook.go` would correspond to the type `LogglyHook`). This file should contain method declarations, interface implementation assertions and any other declarations that are tied solely to that type. | ||
|
|
||
| Each non-test file can have a test counterpart like normal, whose name ends with `_test.go`. The common files described above also have their own test counterparts... for example `internal_test.go` should contains tests that test unexported behavior and more commonly test helpers that are unexported. | ||
|
|
||
| Generally, file contents are sorted by exported/unexported, then declaration type (ordered as consts, vars, types, then funcs), then finally alphabetically. | ||
|
|
||
| ### Test helpers | ||
|
|
||
| Often, we provide test packages that aid in the creation of tests that interact with our other packages. For example, the `support/db` package has the `support/db/dbtest` package underneath it that contains elements that make it easier to test code that accesses a SQL database. We've found that this pattern of having a separate test package maximizes flexibility and simplifies package dependencies. | ||
|
|
||
| [golistcmp]: https://github.com/stellar/golistcmp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Migration Guide | ||
|
|
||
| ## Migrating from github.com/stellar/go to github.com/stellar/go-stellar-sdk | ||
|
|
||
| The Golang SDKs are now located in a new dedicated repo for that sole purpose - https://github.com/stellar/go-stellar-sdk. | ||
|
|
||
| Go client applications that were using SDK packages from `github.com/stellar/go` module will need to change their project to reference the new go module name `github.com/stellar/go-stellar-sdk` and rename package import statements from `github.com/stellar/go/..` to `github.com/stellar/go-stellar-sdk/..` | ||
|
|
||
|
|
||
| ### 1. Update your go.mod | ||
| ```bash | ||
| # Add the new module name | ||
| go get github.com/stellar/go-stellar-sdk@latest | ||
|
|
||
| # Remove the old module name | ||
| go mod edit -droprequire github.com/stellar/go | ||
|
|
||
| go mod tidy | ||
| ``` | ||
|
|
||
| ### 2. Update imports in your code | ||
|
|
||
| **Before:** | ||
| ```go | ||
| import "github.com/stellar/go/.." | ||
| ``` | ||
|
|
||
| **After:** | ||
| ```go | ||
| import "github.com/stellar/go-stellar-sdk/.." | ||
| ``` | ||
|
|
||
| ### 3. Update git remote (if you have the repo cloned) | ||
| ```bash | ||
| git remote set-url origin https://github.com/stellar/go-stellar-sdk.git | ||
| ``` | ||
|
|
||
| ### 4. API Changes | ||
|
|
||
| No breaking API changes - all functions remain the same. | ||
|
|
||
| ### 5. Verify | ||
| ```bash | ||
| go mod tidy | ||
| go test ./... | ||
| ``` | ||
|
|
||
| ## Need Help? | ||
|
|
||
| Open an issue at: https://github.com/stellar/go-stellar-sdk/issues |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.