build core, basic and go variants and add template

This commit is contained in:
Dietrich Rink
2023-06-01 00:54:51 +02:00
parent 76e695ebbb
commit dd67e62569
31 changed files with 800 additions and 2 deletions

17
go/Containerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM code-basic
USER root
ENV HOME=/root
# Install alpine packages
RUN apk add --no-cache go go-doc
# Install go packages
ENV GOPATH=/usr/local/lib/go PATH=/usr/local/lib/go/bin:$PATH
RUN go install golang.org/x/tools/gopls@latest && rm -rf $(go env GOCACHE)
# Add neovim config
COPY nvim /etc/xdg/nvim
# Configure environment
USER 1000:1000
ENV HOME=/tmp

1
go/nvim/init/go.lua Normal file
View File

@@ -0,0 +1 @@
require('lspconfig').gopls.setup {}

View File

@@ -0,0 +1,10 @@
return {
parse(
{ trig = 'func', name = 'Function' },
'func ${1:name}($2) $3{\n\t$4\n}'
),
parse(
{ trig = 'err', name = 'Handle error' },
'if ${2:err} != nil { return ${1}${2} }'
),
}

4
go/podman.args Normal file
View File

@@ -0,0 +1,4 @@
--env
GOPATH=/work/{NAME}/.go
--env
GOCACHE=/work/{NAME}/.go/cache