Skip to content

Commit

Permalink
Fix go generate feed
Browse files Browse the repository at this point in the history
  • Loading branch information
mliezun committed Jan 26, 2024
1 parent 3a93c27 commit ad390d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/md/2024-01-26-go-generics-sfj-db.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Your `sites.json` file could be something like this:
{
"www.example.com": {
"name": "Example",
"host": "www.example.com",
"host": "www.example.com"
}
}
```
Expand Down Expand Up @@ -75,7 +75,7 @@ func (db *DB[T]) Load() error {
if err != nil {
return err
}
return json.Unmarshal(content, &db.data)
return json.Unmarshal(content, &db.data)
}
```

Expand Down Expand Up @@ -129,7 +129,7 @@ Finally we have to implement `Open` to instantiate our DB:
```go
// Open opens a json file as a database.
func Open[T any](filepath string) (db *DB[T], err error) {
db = &DB[T]{filepath: filepath}
db = &DB[T]{filepath: filepath}
if err := db.Load(); err != nil {
return nil, err
}
Expand Down

0 comments on commit ad390d3

Please sign in to comment.