loadout/bin/go-playground

43 lines
707 B
Plaintext
Raw Normal View History

2017-10-18 00:12:57 +00:00
#!/bin/sh
2023-09-26 09:11:40 +00:00
set -e -x
cd "$(mktemp -d)"
cat >main.go <<EOF
package main
import (
"fmt"
)
func main() {
fmt.Println("aloha")
}
EOF
cat >shell.nix <<EOF
let
pkgsVersion = "22.11";
pkgsSrc = fetchTarball {
name = "nixpkgs-\${pkgsVersion}";
url = "https://github.com/NixOS/nixpkgs/archive/ce20e9ebe1903ea2ba1ab006ec63093020c761cb.tar.gz";
sha256 = "sha256-eFNm2h6fNbgD7ZpO4MHikCB5pSnCJ7DTmwPisjetmwc=";
};
pkgs = (import pkgsSrc) {};
in
pkgs.mkShell {
buildInputs = [
pkgs.go
pkgs.golangci-lint
];
shellHook = ''
go mod init local-playground
$EDITOR main.go
'';
}
EOF
nix-shell -v