Initial commit
This commit is contained in:
29
go/.gitignore
vendored
Normal file
29
go/.gitignore
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
# Binaries for programs and plugins
|
||||
*.exe
|
||||
*.exe~
|
||||
*.dll
|
||||
*.so
|
||||
*.dylib
|
||||
|
||||
# Test binary, built with `go test -c`
|
||||
*.test
|
||||
|
||||
# Code coverage profiles and other test artifacts
|
||||
*.out
|
||||
coverage.*
|
||||
*.coverprofile
|
||||
profile.cov
|
||||
|
||||
# Dependency directories (remove the comment below to include it)
|
||||
# vendor/
|
||||
|
||||
# Go workspace file
|
||||
go.work
|
||||
go.work.sum
|
||||
|
||||
# env file
|
||||
.env
|
||||
|
||||
# Editor/IDE
|
||||
# .idea/
|
||||
# .vscode/
|
||||
54
go/flake.nix
Normal file
54
go/flake.nix
Normal file
@@ -0,0 +1,54 @@
|
||||
{
|
||||
description = "Go Project";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [ "x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ];
|
||||
|
||||
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
||||
packages.my-app = pkgs.buildGoModule {
|
||||
pname = "My App";
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
|
||||
vendorHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
|
||||
|
||||
#ldflags = [ "-s" "-w" ];
|
||||
|
||||
nativeBuildInputs = with pkgs; [
|
||||
];
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "A Go Application";
|
||||
mainProgram = "main";
|
||||
};
|
||||
};
|
||||
|
||||
# Set the default package
|
||||
packages.default = self'.packages.my-app;
|
||||
|
||||
# Development shell
|
||||
devShells.default = pkgs.mkShell {
|
||||
|
||||
inputsFrom = [ self'.packages.my-app ];
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
go_1_25
|
||||
gotools
|
||||
golangci-lint
|
||||
gopls
|
||||
go-outline
|
||||
gopkgs
|
||||
go-tools
|
||||
gotests
|
||||
delve
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user