Skip to content

Commit f1b903d

Browse files
committed
Upgrade to go=1.24
1 parent 09511ac commit f1b903d

4 files changed

Lines changed: 15 additions & 28 deletions

File tree

.github/workflows/test.yaml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,40 @@
1+
---
12
name: Go package
2-
3-
on:
4-
- push
5-
3+
on: [push]
64
jobs:
75
test:
86
strategy:
97
matrix:
10-
go-version:
11-
- 1.20.x
12-
- 1.19.x
13-
- 1.18.x
14-
os:
15-
- ubuntu-latest
8+
go-version: [1.24.x, 1.23.x]
9+
os: [ubuntu-latest]
1610
runs-on: ${{ matrix.os }}
17-
1811
steps:
1912
- name: Go version
2013
run: go version
21-
2214
- name: Go env
2315
run: go env
2416

2517
# https://github.com/actions/checkout
2618
- name: checkout repo
2719
uses: actions/checkout@v3
28-
2920
- name: Test
3021
run: make test vet
3122
build:
3223
strategy:
3324
matrix:
34-
go-version:
35-
- 1.20.x
36-
os:
37-
- ubuntu-latest
25+
go-version: [1.24.x]
26+
os: [ubuntu-latest]
3827
runs-on: ${{ matrix.os }}
39-
4028
steps:
4129
- name: Install dependencies
4230
run: sudo apt-get install -y imagemagick icnsutils zip
43-
4431
- name: Go version
4532
run: go version
46-
4733
- name: Go env
4834
run: go env
4935

5036
# https://github.com/actions/checkout
5137
- name: checkout repo
5238
uses: actions/checkout@v3
53-
5439
- name: Build
5540
run: make build

go.mod

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module github.com/jmcfarlane/notable
22

3-
go 1.20
3+
go 1.24
4+
5+
toolchain go1.24.2
46

57
require (
68
github.com/blevesearch/bleve/v2 v2.3.7

handlers.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ func createNote(w http.ResponseWriter, r *http.Request) {
2323
json.Unmarshal(payload, &note)
2424
note, err := db.create(note)
2525
if err != nil {
26-
fmt.Fprintf(w, err.Error())
26+
fmt.Fprint(w, err.Error())
2727
}
2828
noteJSON, err := note.ToJSON()
2929
if err != nil {
30-
fmt.Fprintf(w, err.Error())
30+
fmt.Fprint(w, err.Error())
3131
}
32-
fmt.Fprintf(w, noteJSON)
32+
fmt.Fprint(w, noteJSON)
3333
}
3434

3535
// The current process id
3636
func pid(w http.ResponseWriter, r *http.Request) {
37-
fmt.Fprintf(w, strconv.Itoa(os.Getpid()))
37+
fmt.Fprint(w, strconv.Itoa(os.Getpid()))
3838
}
3939

4040
// Remove a note from storage
@@ -48,7 +48,7 @@ func deleteNote(w http.ResponseWriter, r *http.Request) {
4848
}
4949
outcome.Success = true
5050
outcomeJSON, _ := json.Marshal(outcome)
51-
fmt.Fprintf(w, string(outcomeJSON))
51+
fmt.Fprint(w, string(outcomeJSON))
5252
}
5353

5454
// Fetch note content from the database by it's uid.

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ func index(w http.ResponseWriter, r *http.Request) {
6161
func notFoundHandler(w http.ResponseWriter, req *http.Request) {
6262
fmt.Println("Serving:", req.URL, "[404]")
6363
w.WriteHeader(http.StatusNotFound)
64-
fmt.Fprintf(w, fmt.Sprintf("%d", http.StatusNotFound))
64+
fmt.Fprintf(w, "%d", http.StatusNotFound)
6565
}
6666

6767
func browserCmd(goos string) (string, []string) {

0 commit comments

Comments
 (0)