From d960518264fc2e853ea56bae61c1b4cd07da1991 Mon Sep 17 00:00:00 2001 From: pardoe Date: Sat, 4 Jul 2026 12:37:43 -0500 Subject: [PATCH 1/6] add name line at the bottom --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c2bec0368b7..08e6ba4b556 100644 --- a/README.md +++ b/README.md @@ -21,3 +21,4 @@ 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! +EDUARDO's version of Boot.dev's Notely app From b01936a21f8d04d9d4053df2fbdb52d114ddd289 Mon Sep 17 00:00:00 2001 From: pardoe Date: Sat, 4 Jul 2026 13:21:57 -0500 Subject: [PATCH 2/6] added 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..664032071d1 --- /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@v6 + + - name: Set up Go + uses: actions/setup-go@v6 + with: + go-version: "1.26.0" + + - name: Force Failure + run: (exit 1) \ No newline at end of file From 66ac7c18d3663d34279b5a1672796bb900ceaf5d Mon Sep 17 00:00:00 2001 From: pardoe Date: Sat, 4 Jul 2026 13:42:12 -0500 Subject: [PATCH 3/6] added go version in Force Failure job --- .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 664032071d1..40bdca78318 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) \ No newline at end of file + run: go version \ No newline at end of file From 1c21dbe4b9d7912ddcb4d5436076a0d6bacf8e61 Mon Sep 17 00:00:00 2001 From: pardoe Date: Sat, 4 Jul 2026 14:04:32 -0500 Subject: [PATCH 4/6] break code --- .github/workflows/ci.yml | 4 ++-- internal/auth/get_api_key_test.go | 29 +++++++++++++++++++++++++++++ main.go | 2 +- 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 internal/auth/get_api_key_test.go diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40bdca78318..ef12c3b209d 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 version \ No newline at end of file + - name: Run My Tests + run: go test ./... \ No newline at end of file diff --git a/internal/auth/get_api_key_test.go b/internal/auth/get_api_key_test.go new file mode 100644 index 00000000000..e60830afd9d --- /dev/null +++ b/internal/auth/get_api_key_test.go @@ -0,0 +1,29 @@ +package auth + +import ( + "errors" + "net/http" + "testing" +) + +func TestGetAPIKey(t *testing.T) { + headers := http.Header{} + headers.Set("Authorization", "ApiKey my-secret-key") + + got, err := GetAPIKey(headers) + if err != nil { + t.Fatalf("expected no error, got %v", err) + } + if got != "my-secret-key" { + t.Fatalf("expected API key %q, got %q", "my-secret-key", got) + } +} + +func TestGetAPIKeyNoAuthHeader(t *testing.T) { + headers := http.Header{} + + _, err := GetAPIKey(headers) + if !errors.Is(err, ErrNoAuthHeaderIncluded) { + t.Fatalf("expected ErrNoAuthHeaderIncluded, got %v", err) + } +} diff --git a/main.go b/main.go index 19d7366c5f7..c2747129fa0 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ package main -import ( +//import ( "database/sql" "embed" "io" From 533bf0c8969f99cf2db65cbacbca4fdac473380c Mon Sep 17 00:00:00 2001 From: pardoe Date: Sat, 4 Jul 2026 14:10:01 -0500 Subject: [PATCH 5/6] break code --- .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 ef12c3b209d..b613a00481b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.26.0" - - name: Run My Tests + - name: Ruunit tests run: go test ./... \ No newline at end of file From 52dbfb29373c7fbbbd4a90c909c41baa25fe9438 Mon Sep 17 00:00:00 2001 From: pardoe Date: Sat, 4 Jul 2026 14:16:42 -0500 Subject: [PATCH 6/6] fixed code --- .github/workflows/ci.yml | 2 +- main.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b613a00481b..b0e7f34491f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,5 @@ jobs: with: go-version: "1.26.0" - - name: Ruunit tests + - name: Run unit tests run: go test ./... \ No newline at end of file diff --git a/main.go b/main.go index c2747129fa0..19d7366c5f7 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,6 @@ package main -//import ( +import ( "database/sql" "embed" "io"