fucking go module system

This commit is contained in:
Johannes Theiner 2020-07-20 20:31:18 +02:00
parent 6e2437dbdd
commit 4e1c629ff3
7 changed files with 26 additions and 9 deletions

View File

@ -3,12 +3,12 @@ RUN mkdir -p /go/src/folder
WORKDIR /go/src/folder
COPY /src .
RUN go get -d
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o main .
RUN go get -u ./...
RUN go build
FROM alpine:latest
WORKDIR /
COPY --from=builder /go/src/folder/main .
COPY --from=builder /go/src/folder/weatherservice .
EXPOSE 8080
CMD ["/main"]
CMD ["/weatherservice"]

View File

@ -1,9 +1,9 @@
package client
import (
"../config"
"encoding/json"
"io/ioutil"
"joethei.xyz/weather/config"
"log"
"net/http"
"strconv"

3
src/client/go.mod Normal file
View File

@ -0,0 +1,3 @@
module client
go 1.14

1
src/config/go.mod Normal file
View File

@ -0,0 +1 @@
module config

View File

@ -1,9 +1,9 @@
package main
import (
"./config"
"./server"
"github.com/getsentry/sentry-go"
"joethei.xyz/weather/config"
"joethei.xyz/weather/server"
)
func main() {

View File

@ -1,8 +1,6 @@
package server
import (
"../client"
"../config"
"encoding/json"
"github.com/auth0/go-jwt-middleware"
"github.com/dgrijalva/jwt-go"
@ -14,6 +12,8 @@ import (
"github.com/throttled/throttled/store/memstore"
"github.com/victorspringer/http-cache"
"github.com/victorspringer/http-cache/adapter/memory"
"joethei.xyz/weather/client"
"joethei.xyz/weather/config"
"log"
"net/http"
"strconv"

13
src/server/go.mod Normal file
View File

@ -0,0 +1,13 @@
module server
go 1.14
require (
github.com/auth0/go-jwt-middleware v0.0.0-20200507191422-d30d7b9ece63 // indirect
github.com/getsentry/sentry-go v0.6.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/justinas/alice v1.2.0 // indirect
github.com/justinas/nosurf v1.1.0 // indirect
github.com/throttled/throttled v2.2.4+incompatible // indirect
github.com/victorspringer/http-cache v0.0.0-20190721184638-fe78e97af707 // indirect
)