Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go; Update Actions deps #18

Merged
merged 3 commits into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.

- name: Set up Go
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version: 1.17
go-version: 1.22

- uses: actions/cache@v2
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ jobs:
environment: staging
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- id: "auth"
uses: "google-github-actions/auth@v0"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_SA_CREDS_JSON }}"

# Workaround to support Gen2 Cloud Functions
# https://github.com/google-github-actions/deploy-cloud-functions/issues/304
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v0"
uses: "google-github-actions/setup-gcloud@v2"

- id: "deploy"
run: >
Expand All @@ -34,7 +34,7 @@ jobs:
--gen2
--region=us-central1
--source=.
--runtime=go118
--runtime=go122
--trigger-http
--allow-unauthenticated
--entry-point=ServeShorty
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ jobs:
environment: production
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- id: "auth"
uses: "google-github-actions/auth@v0"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_SA_CREDS_JSON }}"

# Workaround to support Gen2 Cloud Functions
# https://github.com/google-github-actions/deploy-cloud-functions/issues/304
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v0"
uses: "google-github-actions/setup-gcloud@v2"

- id: "deploy"
run: >
Expand All @@ -33,7 +33,7 @@ jobs:
--gen2
--region=us-central1
--source=.
--runtime=go118
--runtime=go122
--trigger-http
--allow-unauthenticated
--entry-point=ServeShorty
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# **URL Shortening Service (Go)**

![Coverage](https://img.shields.io/badge/Coverage-55.7%25-yellow)
![Coverage](https://img.shields.io/badge/Coverage-54.6%25-yellow)

Create short URLs, resolve shortened URLs, and fetch all shortened URLs.

Expand Down
2 changes: 1 addition & 1 deletion function.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewApp() *http.ServeMux {
errorClient.Report(errorreporting.Entry{
Error: fmt.Errorf("initStore: %v", err),
})
log.Fatal("Could not start")
log.Fatalf("Could not start: %v", err)
}

baseURL := os.Getenv("HOST_BASE_URL")
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/operationspark/shorty

go 1.19
go 1.22

require (
cloud.google.com/go/errorreporting v0.2.0
Expand Down
3 changes: 3 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down Expand Up @@ -228,6 +229,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2 h1:hRGSmZu7j271trc9sneMrpOW7GN5ngLm8YUZIPzf394=
github.com/lib/pq v0.0.0-20180327071824-d34b9ff171c2/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/moby/sys/mountinfo v0.5.0/go.mod h1:3bMD3Rg+zkqx8MRYPi7Pyb0Ie97QEBmdxbhnCLlSvSU=
Expand Down Expand Up @@ -728,6 +730,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gotest.tools/v3 v3.0.2/go.mod h1:3SzNCllyD9/Y+b5r9JIKQ474KzkZyqLqEfYqMsX94Bk=
gotest.tools/v3 v3.2.0 h1:I0DwBVMGAx26dttAj1BtJLAkVGncrkkUXfJLC4Flt/I=
gotest.tools/v3 v3.2.0/go.mod h1:Mcr9QNxkg0uMvy/YElmo4SpXgJKWgQvYrT7Kw5RzJ1A=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
Expand Down
12 changes: 12 additions & 0 deletions my-coverfile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
mode: atomic
github.com/operationspark/shorty/function.go:14.13,19.2 1 1
github.com/operationspark/shorty/function.go:23.30,25.16 2 1
github.com/operationspark/shorty/function.go:29.2,29.31 1 1
github.com/operationspark/shorty/function.go:25.16,26.13 1 0
github.com/operationspark/shorty/function.go:33.46,34.31 1 1
github.com/operationspark/shorty/function.go:37.2,38.24 2 1
github.com/operationspark/shorty/function.go:42.2,43.16 2 1
github.com/operationspark/shorty/function.go:46.2,46.19 1 1
github.com/operationspark/shorty/function.go:34.31,36.3 1 0
github.com/operationspark/shorty/function.go:38.24,40.3 1 1
github.com/operationspark/shorty/function.go:43.16,45.3 1 0