Skip to content

fix: Updated the Go template to use Go 1.23 instead of 1.16! - #89

Open
ElrohirGT wants to merge 4 commits into
NixOS:masterfrom
ElrohirGT:fix/updated-go-template
Open

fix: Updated the Go template to use Go 1.23 instead of 1.16!#89
ElrohirGT wants to merge 4 commits into
NixOS:masterfrom
ElrohirGT:fix/updated-go-template

Conversation

@ElrohirGT

Copy link
Copy Markdown

Hello! I've been programming some projects in Go recently and I really like the templates! But I can see that the go version used for the template is a little old, this PR aims to update the go version of the package and the dev environment to 1.23 to make it easier to start a go project on the most recent stable version.

Comment thread go-hello/flake.nix
@@ -48,7 +48,7 @@
# remember to bump this hash when your dependencies change.
# vendorHash = pkgs.lib.fakeHash;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not set pkgs.lib.fakeHash?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when I try to use nix run on the main.go from the example and the property is vendorHash = pkgs.lib.fakeHash; it fails with:

image

So I just followed the suggestion haha.

The complete log is:

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/0q954y6cv7baz5q3izp9yxjssisms2fp-go-hello
source root is go-hello
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
go: no dependencies to vendor
Running phase: installPhase
@nix { "action": "setPhase", "phase": "installPhase" }
vendor folder is empty, please set 'vendorHash = null;' in your expression

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok interesting

@daemonfire300

Copy link
Copy Markdown

Any help needed here?

@ElrohirGT

Copy link
Copy Markdown
Author

Maybe? I don't really know what's missing for this PR to be merged.

Since you remembered me this PR still existed, I updated the NixOS channel version to the most recent one. So the template has the most recent "stable" go version!

@daemonfire300

Copy link
Copy Markdown

Maybe? I don't really know what's missing for this PR to be merged.

Since you remembered me this PR still existed, I updated the NixOS channel version to the most recent one. So the template has the most recent "stable" go version!

I stumbled upon this repo, because I wanted to try out the official flake templates and then noticed it is quite outdated. I think it is not just the go version that would need a fix up. 😄

@ElrohirGT

Copy link
Copy Markdown
Author

Yeah haha, I think this repo is largely abandoned.

Still, I'm thankful! It helped me start learning Nix and now I have my own templates!

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.

3 participants