Add hr init go

This commit is contained in:
Sage 2026-02-18 13:36:59 +00:00
parent a3bd6990b5
commit 2fa75b084b

View file

@ -10,6 +10,7 @@ _hr_usage() {
echo " call Call a Cloud Run service route" echo " call Call a Cloud Run service route"
echo " cf Call a Cloud Function" echo " cf Call a Cloud Function"
echo " init py Initialize a python devenv environment (git-ignored)" echo " init py Initialize a python devenv environment (git-ignored)"
echo " init go Initialize a go devenv environment (git-ignored)"
echo " freeze Freeze dependencies to requirements.txt" echo " freeze Freeze dependencies to requirements.txt"
} }
@ -137,6 +138,16 @@ in {
EOF EOF
} }
_hr_go_files() {
cat <<EOF >devenv.nix
{pkgs, ...}: {
languages.go = {
enable = true;
};
}
EOF
}
_hr_init_base() { _hr_init_base() {
local name="$1" local name="$1"
local func="$2" local func="$2"
@ -186,6 +197,10 @@ _hr_init_cpp() {
cp compile_commands.json .. cp compile_commands.json ..
} }
_hr_init_go() {
_hr_init_base "Go" _hr_go_files
}
_hr_freeze() { _hr_freeze() {
local extra_index_url="https://europe-west1-python.pkg.dev/mk2-prod/python-packages/simple/" local extra_index_url="https://europe-west1-python.pkg.dev/mk2-prod/python-packages/simple/"
@ -376,6 +391,8 @@ hr() {
_hr_init_py _hr_init_py
elif [ "$1" = "init" ] && [ "$2" = "rs" ]; then elif [ "$1" = "init" ] && [ "$2" = "rs" ]; then
_hr_init_rs _hr_init_rs
elif [ "$1" = "init" ] && [ "$2" = "go" ]; then
_hr_init_go
elif [ "$1" = "init" ] && [ "$2" = "cpp" ]; then elif [ "$1" = "init" ] && [ "$2" = "cpp" ]; then
_hr_init_cpp _hr_init_cpp
elif [ "$1" = "freeze" ]; then elif [ "$1" = "freeze" ]; then