Skip to content

Commit

Permalink
Go 1.16, output Go version and update lib/pq
Browse files Browse the repository at this point in the history
  • Loading branch information
gogolok committed Feb 23, 2021
1 parent 68f1f56 commit cb0c3eb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
12 changes: 9 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
FROM golang:1.15
FROM golang:1.16

WORKDIR /app
COPY . /app/
RUN go get github.com/lib/pq
COPY go.mod go.mod
COPY go.sum go.sum

RUN go mod download

COPY main.go main.go
COPY templates templates
COPY public public

EXPOSE 3000
CMD ["go","run","main.go"]
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ module github.com/anynines/a9s-postgresql-app

go 1.15

require github.com/lib/pq v1.2.0
require github.com/lib/pq v1.9.0
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
github.com/lib/pq v1.2.0 h1:LXpIM/LZ5xGFhOpXAQUIMM1HdyqzVYM13zNdjCEEcA0=
github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/lib/pq v1.9.0 h1:L8nSXQQzAYByakOFMTwpjRoHsMJklur4Gi59b6VivR8=
github.com/lib/pq v1.9.0/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
3 changes: 3 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"log"
"net/http"
"os"
"runtime"
"strconv"

_ "github.com/lib/pq"
Expand Down Expand Up @@ -228,6 +229,8 @@ func renderBlogPosts(w http.ResponseWriter, r *http.Request) {
}

func main() {
log.Println(runtime.Version())

initTemplates()
initDatabase()

Expand Down

0 comments on commit cb0c3eb

Please sign in to comment.