build core, basic and go variants and add template
This commit is contained in:
17
go/Containerfile
Normal file
17
go/Containerfile
Normal 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
1
go/nvim/init/go.lua
Normal file
@@ -0,0 +1 @@
|
||||
require('lspconfig').gopls.setup {}
|
||||
10
go/nvim/luasnippets/go.lua
Normal file
10
go/nvim/luasnippets/go.lua
Normal 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
4
go/podman.args
Normal file
@@ -0,0 +1,4 @@
|
||||
--env
|
||||
GOPATH=/work/{NAME}/.go
|
||||
--env
|
||||
GOCACHE=/work/{NAME}/.go/cache
|
||||
Reference in New Issue
Block a user