Skip to content

Commit

Permalink
go: Initial commit
Browse files Browse the repository at this point in the history
Common packages for working on Go projects.

I frequently use this from my editor with:

- https://github.com/flox/flox-direnv

And the following in `.envrc`:

    use flox --remote floxenvs/go

In future the editor dependencies could be broken out to a separate
`go-editor` or `go-lsp` environment.

The `GOENV` hook is copied from our `init --auto-setup` hook with the
exception of:

1. Path is modified from `goenv` to `go` to match the other example
   environments in this repo
2. `go get .` is omitted because it's surprising to fetch dependencies
   when activating an environment and we have plans to remove it from
   the default manifest.

The example module which includes a third-party module to prove that
dependency fetching still works is taken from:

- https://go.dev/blog/using-go-modules

The minimum Go version is currently pinned, both in the `manifest.toml`
and `go.mod`, at the latest stable major and minor version. It should
continue to work after a `flox upgrade` assuming that there are no
breaking changes.
  • Loading branch information
dcarley committed Oct 29, 2024
1 parent c8c211a commit 1cb8d22
Show file tree
Hide file tree
Showing 10 changed files with 945 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/*/.flox/cache
/*/.flox/log
/*/.flox/run
go/hello
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
| :--- | :-----: | :----: | :-----: | :---------- |
| |
| **Languages:** |
| `go` |||| |
| `python-poetry` |||| Python environment using poerty |
| `ruby` |||| Ruby environment |
| `rust` |||| Rust environment |
Expand Down
4 changes: 4 additions & 0 deletions go/.flox/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
run/
cache/
lib/
log/
4 changes: 4 additions & 0 deletions go/.flox/env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "go",
"version": 1
}
Loading

0 comments on commit 1cb8d22

Please sign in to comment.