From 0eb23e88a1d6ec11f02cba7a9bc4427fc4d23de5 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 12 May 2026 09:44:41 -0700 Subject: [PATCH 01/34] Update README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c2bec0368b7..cac2d4323a7 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,5 @@ go build -o notely && ./notely *This starts the server in non-database mode.* It will serve a simple webpage at `http://localhost:8080`. You do *not* need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course! + +Jordan's version of Boot.dev's Notely app From 971df65e341a93bcd65393d41d57592de1699dbc Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 12 May 2026 09:56:57 -0700 Subject: [PATCH 02/34] created .github dir, workflows dir, and ci.yml file --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000000..c3db7596c77 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: ci + +on: + pull_request: + branches: [main] + +jobs: + tests: + name: Tests + runs-on: ubuntu-latest + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.26.0" + + - name: Force Failure + run: (exit 1) From 83a607cb858e493146a6dc159762aff73c8a0d48 Mon Sep 17 00:00:00 2001 From: Jordan Date: Tue, 12 May 2026 10:05:08 -0700 Subject: [PATCH 03/34] updated check --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3db7596c77..93928a30166 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: go-version: "1.26.0" - name: Force Failure - run: (exit 1) + run: go version From 5729c5e0ffd20ecd7154d6aa051b8deb936a91eb Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 13 May 2026 09:02:30 -0700 Subject: [PATCH 04/34] updated ci.yml file for testing --- .github/workflows/ci.yml | 2 +- internal/auth/get_api_key_test.go | 42 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 internal/auth/get_api_key_test.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93928a30166..b0bc133693b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,4 +19,4 @@ jobs: go-version: "1.26.0" - name: Force Failure - run: go version + run: go test ./... diff --git a/internal/auth/get_api_key_test.go b/internal/auth/get_api_key_test.go new file mode 100644 index 00000000000..9451ee4373b --- /dev/null +++ b/internal/auth/get_api_key_test.go @@ -0,0 +1,42 @@ + +package auth + +import ( + "testing" + "net/http" + "strings" +) + +func TestAPIKey(t *testing.T) { + // 1. Define the 'table' of test cases + tests := []struct { + name string + inputHeader http.Header + expectedKey string + expectedError string + }{ + {name: "valid api key", + inputHeader: http.Header{ + "Authorization": []string{"ApiKey secret-sauce"}, + }, + expectedKey: "secret-sauce", + expectedError: "", + }, + } + + // 2. Iterate over the table + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + apiKey, err := GetAPIKey(tt.inputHeader) + if err != nil { + if !strings.Contains(err.Error(), tt.expectedError) { + t.Errorf("expected error containing %s, got %v", tt.expectedError, err) + } + return + } + if apiKey != tt.expectedKey { + t.Errorf("expected %s, got %s", tt.expectedKey, apiKey) + } + }) + } +} From b2334fbf1c212abcb1c7516e8b1c10e8b63d27ac Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 13 May 2026 09:04:44 -0700 Subject: [PATCH 05/34] break auth logic with potato --- internal/auth/auth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index f969aacf638..e725dcd6ff9 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -15,7 +15,7 @@ func GetAPIKey(headers http.Header) (string, error) { return "", ErrNoAuthHeaderIncluded } splitAuth := strings.Split(authHeader, " ") - if len(splitAuth) < 2 || splitAuth[0] != "ApiKey" { + if len(splitAuth) < 2 || splitAuth[0] != "potato" { return "", errors.New("malformed authorization header") } From 77e7b614663a69da50c1c1071e33c6fcdf9540fe Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 13 May 2026 09:44:43 -0700 Subject: [PATCH 06/34] alternate test change --- internal/auth/auth.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index e725dcd6ff9..6d1262e3296 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -10,12 +10,13 @@ var ErrNoAuthHeaderIncluded = errors.New("no authorization header included") // GetAPIKey - func GetAPIKey(headers http.Header) (string, error) { + this_is_not_a_variable = 123 authHeader := headers.Get("Authorization") if authHeader == "" { return "", ErrNoAuthHeaderIncluded } splitAuth := strings.Split(authHeader, " ") - if len(splitAuth) < 2 || splitAuth[0] != "potato" { + if len(splitAuth) < 2 || splitAuth[0] != "apiKey" { return "", errors.New("malformed authorization header") } From 2235586243ab2a14e1a6604ea37f34452ff4efff Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 13 May 2026 09:48:41 -0700 Subject: [PATCH 07/34] fixed --- internal/auth/auth.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 6d1262e3296..834779b283d 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -10,7 +10,6 @@ var ErrNoAuthHeaderIncluded = errors.New("no authorization header included") // GetAPIKey - func GetAPIKey(headers http.Header) (string, error) { - this_is_not_a_variable = 123 authHeader := headers.Get("Authorization") if authHeader == "" { return "", ErrNoAuthHeaderIncluded From 8d45ed403249727a4cd667f728b9e6516c35ab23 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 13 May 2026 10:11:08 -0700 Subject: [PATCH 08/34] added -cover to test input --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b0bc133693b..8918c5907b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.26.0" - - name: Force Failure - run: go test ./... + - name: Run unit tests + run: go test ./... -cover From df907003a103e790c8a1174a17199c92ba73b628 Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 13 May 2026 10:31:39 -0700 Subject: [PATCH 09/34] added badge to README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index cac2d4323a7..df9127130ab 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,6 @@ + +![CI](https://github.com/ArchAngel77/cicd/actions/workflows/ci.yml/badge.svg) + # learn-cicd-starter (Notely) This repo contains the starter code for the "Notely" application for the "Learn CICD" course on [Boot.dev](https://boot.dev). From 23d6c22d7d53ea5ea722af898273464b53bc3c9f Mon Sep 17 00:00:00 2001 From: Jordan Date: Wed, 13 May 2026 10:36:49 -0700 Subject: [PATCH 10/34] add CI badge to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index df9127130ab..c76a210263c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -![CI](https://github.com/ArchAngel77/cicd/actions/workflows/ci.yml/badge.svg) +![CI](https://github.com/ArchAngel77/learn-cicd-starter/actions/workflows/ci.yml/badge.svg) # learn-cicd-starter (Notely) From ee85622bc469443a600092e22695e5c1d3e9acf3 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:10:28 -0700 Subject: [PATCH 11/34] added staticcheck --- main.go | 1 - 1 file changed, 1 deletion(-) diff --git a/main.go b/main.go index 19d7366c5f7..f9064440a0a 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,6 @@ type apiConfig struct { DB *database.Queries } -//go:embed static/* var staticFiles embed.FS func main() { From 6e03a1f0cbec723eba72566f65e918d8cdbd00ba Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:25:57 -0700 Subject: [PATCH 12/34] updated yml test --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8918c5907b9..70cb14a2ace 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,3 +20,24 @@ jobs: - name: Run unit tests run: go test ./... -cover + + style: + name: Style + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: "1.25.1" + + - name: Check formatting + run: test -z $(go fmt ./...) + + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest + + - name: Run staticcheck + run: staticcheck ./... From 1a6698c018136b1ae8e5bd79c7c40dd092faa1c8 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:35:20 -0700 Subject: [PATCH 13/34] remove unused function --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70cb14a2ace..991e395e435 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,7 @@ name: ci +name: + on: pull_request: branches: [main] From 556b497b4ae981cf6683b0acbd95795b30435664 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:37:19 -0700 Subject: [PATCH 14/34] remove unused function --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 991e395e435..70cb14a2ace 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,7 +1,5 @@ name: ci -name: - on: pull_request: branches: [main] From 9c41867f53b485c3e29ce1f6e0166c96fa515352 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:40:27 -0700 Subject: [PATCH 15/34] updated formatting in yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 70cb14a2ace..fa6a5ed97dc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.25.1" + go-version: "1.25.1" - name: Check formatting run: test -z $(go fmt ./...) From 6e81b2abfdf7ef7f1818c079e7362310334a13ff Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:43:16 -0700 Subject: [PATCH 16/34] trigger ci From fc95c09f4ec58039c32023ce4c9d4bee7fdb344c Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:45:03 -0700 Subject: [PATCH 17/34] trigger ci From cbef9c483367612a6af4ec604be98d8c99a924bd Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:45:42 -0700 Subject: [PATCH 18/34] trigger ci From 1d1a13d890f141a81be0e150aca74c15dd51e791 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:47:47 -0700 Subject: [PATCH 19/34] retrigger pr checks From a4747b7f34188ed00452ec4701f9e955d6258913 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 07:57:12 -0700 Subject: [PATCH 20/34] fix ci style job --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa6a5ed97dc..3340f5500f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,12 +26,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.25.1" + go-version: "1.25.1" - name: Check formatting run: test -z $(go fmt ./...) From 1ac7b9c32106503f1a34c73751a3b438dbc39502 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 08:16:14 -0700 Subject: [PATCH 21/34] add push trigger for ci --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3340f5500f3..9e4a8f99c12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,8 @@ name: ci on: pull_request: branches: [main] + push: + branches: [addtests] jobs: tests: From d3f79c42d3eb381e43ef6a0cf832d8b2c121a9fc Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 08:18:16 -0700 Subject: [PATCH 22/34] format go files --- internal/auth/get_api_key_test.go | 61 +++++++++++++++---------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/internal/auth/get_api_key_test.go b/internal/auth/get_api_key_test.go index 9451ee4373b..155a1587083 100644 --- a/internal/auth/get_api_key_test.go +++ b/internal/auth/get_api_key_test.go @@ -1,42 +1,41 @@ - package auth import ( - "testing" "net/http" "strings" + "testing" ) func TestAPIKey(t *testing.T) { - // 1. Define the 'table' of test cases - tests := []struct { - name string - inputHeader http.Header - expectedKey string - expectedError string - }{ - {name: "valid api key", - inputHeader: http.Header{ - "Authorization": []string{"ApiKey secret-sauce"}, - }, - expectedKey: "secret-sauce", - expectedError: "", - }, + // 1. Define the 'table' of test cases + tests := []struct { + name string + inputHeader http.Header + expectedKey string + expectedError string + }{ + {name: "valid api key", + inputHeader: http.Header{ + "Authorization": []string{"ApiKey secret-sauce"}, + }, + expectedKey: "secret-sauce", + expectedError: "", + }, } - // 2. Iterate over the table - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - apiKey, err := GetAPIKey(tt.inputHeader) - if err != nil { - if !strings.Contains(err.Error(), tt.expectedError) { - t.Errorf("expected error containing %s, got %v", tt.expectedError, err) - } - return - } - if apiKey != tt.expectedKey { - t.Errorf("expected %s, got %s", tt.expectedKey, apiKey) - } - }) - } + // 2. Iterate over the table + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + apiKey, err := GetAPIKey(tt.inputHeader) + if err != nil { + if !strings.Contains(err.Error(), tt.expectedError) { + t.Errorf("expected error containing %s, got %v", tt.expectedError, err) + } + return + } + if apiKey != tt.expectedKey { + t.Errorf("expected %s, got %s", tt.expectedKey, apiKey) + } + }) + } } From e0d398e5826e760dfb791d2a753c8309f6653bb6 Mon Sep 17 00:00:00 2001 From: Jordan Date: Thu, 14 May 2026 08:21:13 -0700 Subject: [PATCH 23/34] remove push trigger --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e4a8f99c12..3340f5500f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,8 +3,6 @@ name: ci on: pull_request: branches: [main] - push: - branches: [addtests] jobs: tests: From 624a4a9e15593a1f6ee038d8a83d45d30e119da0 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 08:17:27 -0700 Subject: [PATCH 24/34] added formating to ci.yml --- .github/workflows/ci.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3340f5500f3..c00f3a62340 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up Go uses: actions/setup-go@v5 @@ -29,15 +29,9 @@ jobs: uses: actions/checkout@v5 - name: Set up Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: - go-version: "1.25.1" + go-version: "1.26.0" - - name: Check formatting + - name: Style run: test -z $(go fmt ./...) - - - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@latest - - - name: Run staticcheck - run: staticcheck ./... From d904297bc8c015ea8435cbc09483feadc22609c6 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 14:06:23 -0700 Subject: [PATCH 25/34] added gosec --- .github/workflows/ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c00f3a62340..9efcb7a80d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,8 +6,11 @@ on: jobs: tests: - name: Tests - runs-on: ubuntu-latest + - name: Tests + runs-on: ubuntu-latest + + - name: Install gosec + run: go install github.com/securego/gosec/v2/cmd/gosec@latest steps: - name: Check out code From 0f9bd739b3264ca90238f573a0ae0cdc86a9b6c1 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 14:21:46 -0700 Subject: [PATCH 26/34] corrected gosec found errors --- json.go | 5 ++++- main.go | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/json.go b/json.go index 1e6e7985e18..6f35f2c46b3 100644 --- a/json.go +++ b/json.go @@ -30,5 +30,8 @@ func respondWithJSON(w http.ResponseWriter, code int, payload interface{}) { return } w.WriteHeader(code) - w.Write(dat) + _, err = w.Write(dat) + if err != nil { + log.Printf("Critical error writing response: %s" ,err) + } } diff --git a/main.go b/main.go index f9064440a0a..560a9d4e3dd 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "log" "net/http" "os" + "strconv" "github.com/go-chi/chi" "github.com/go-chi/cors" @@ -90,8 +91,9 @@ func main() { srv := &http.Server{ Addr: ":" + port, Handler: router, + ReadHeaderTimeout: time.Second * 5 } - log.Printf("Serving on port: %s\n", port) + log.Printf("Serving on port: %s\n", strconv.Quote(port)) log.Fatal(srv.ListenAndServe()) } From 82fcab5a0b313ac10112ce3d3a607b4fa82265aa Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 14:27:53 -0700 Subject: [PATCH 27/34] corrections to previous problems --- .github/workflows/ci.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9efcb7a80d5..a96d2776d7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,24 +6,27 @@ on: jobs: tests: - - name: Tests - runs-on: ubuntu-latest - - - name: Install gosec - run: go install github.com/securego/gosec/v2/cmd/gosec@latest + name: Tests + runs-on: ubuntu-latest steps: - name: Check out code uses: actions/checkout@v5 - name: Set up Go - uses: actions/setup-go@v5 + uses: actions/setup-go@5 with: go-version: "1.26.0" - name: Run unit tests run: go test ./... -cover + - name: Install gosec + run: go install github.com/securego/gosec/v2/cmd/gosec@latest + + - name: Run gosec + run: gosec ./... + style: name: Style runs-on: ubuntu-latest @@ -38,3 +41,6 @@ jobs: - name: Style run: test -z $(go fmt ./...) + + - name: Run staticcheck + run: staticcheck ./... From 0d8ff8cab54cce860555a3ac433d2c7d4e58e6ea Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 14:41:05 -0700 Subject: [PATCH 28/34] fix ci.yml --- .github/workflows/ci.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a96d2776d7c..d27af0715b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,12 +11,12 @@ jobs: steps: - name: Check out code - uses: actions/checkout@v5 + uses: actions/checkout@v4 - name: Set up Go - uses: actions/setup-go@5 + uses: actions/setup-go@v5 with: - go-version: "1.26.0" + go-version: "1.25.1" - name: Run unit tests run: go test ./... -cover @@ -32,15 +32,18 @@ jobs: runs-on: ubuntu-latest steps: - name: Check out code - uses: actions/checkout@v5 + uses: actions/checkout@v4 - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.26.0" + go-version: "1.25.1" - name: Style run: test -z $(go fmt ./...) + - name: Install staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest + - name: Run staticcheck run: staticcheck ./... From 16631204ecfa661d8802bd95129bb507052acac1 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 14:43:57 -0700 Subject: [PATCH 29/34] trigger ci --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d27af0715b1..0d77d99092e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,3 +47,4 @@ jobs: - name: Run staticcheck run: staticcheck ./... + From 93dd6d911a34a86fabadc465bb434ef363d6da90 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 15:02:58 -0700 Subject: [PATCH 30/34] indentations correction --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0d77d99092e..b1daf7e3ce9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: with: go-version: "1.25.1" - - name: Style + - name: Check formatting run: test -z $(go fmt ./...) - name: Install staticcheck From c5690649b48e34a1b9013c125b517a63b21b10f5 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 15:08:27 -0700 Subject: [PATCH 31/34] fix gosec issues in main.go --- main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 560a9d4e3dd..b551d341425 100644 --- a/main.go +++ b/main.go @@ -8,6 +8,7 @@ import ( "net/http" "os" "strconv" + "time" "github.com/go-chi/chi" "github.com/go-chi/cors" @@ -22,6 +23,7 @@ type apiConfig struct { DB *database.Queries } +//go:embed static/* var staticFiles embed.FS func main() { @@ -91,7 +93,7 @@ func main() { srv := &http.Server{ Addr: ":" + port, Handler: router, - ReadHeaderTimeout: time.Second * 5 + ReadHeaderTimeout: time.Second * 5, } log.Printf("Serving on port: %s\n", strconv.Quote(port)) From 320c144fd2717c65bef459cdc94e5112f6c46997 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 22:17:39 -0700 Subject: [PATCH 32/34] added to main.go, need to take away --- main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.go b/main.go index b551d341425..f7e3bdd032c 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,9 @@ import ( type apiConfig struct { DB *database.Queries } +type something stuct { +} //go:embed static/* var staticFiles embed.FS From 7f3f1c9c52fe968439bdb6880f3b60e3b3a95021 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 22:18:07 -0700 Subject: [PATCH 33/34] corrected --- main.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/main.go b/main.go index f7e3bdd032c..b551d341425 100644 --- a/main.go +++ b/main.go @@ -22,9 +22,7 @@ import ( type apiConfig struct { DB *database.Queries } -type something stuct { -} //go:embed static/* var staticFiles embed.FS From 2812eb89821a174d01b570a378f66887e015f1e9 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 15 May 2026 22:18:44 -0700 Subject: [PATCH 34/34] trigger ci run --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c76a210263c..902590ed3b5 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,4 @@ go build -o notely && ./notely You do *not* need to set up a database or any interactivity on the webpage yet. Instructions for that will come later in the course! Jordan's version of Boot.dev's Notely app +# trigger