Skip to content

Commit

Permalink
Merge pull request #328 from plunkettscott/fix/netip-import
Browse files Browse the repository at this point in the history
Add `net/netip` to random expr imports
  • Loading branch information
stephenafamo authored Dec 15, 2024
2 parents 3723387 + 2770bb3 commit b263af1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Fix random value generation for pq.Float64Array factory (thanks @felipeparaujo)
- Using the `UpdateMod()` and `DeleteMod()` methods on an empty model slice now appends `WHERE primary_key IN NULL` which will return no results. Instead of `WHERE primary_key IN ()` which is a syntax error.
- Ensure `net/netip` is imported for the `pgtypes.Inet` random expression (thanks @plunkettscott)

## [v0.29.0] - 2024-11-20

Expand Down
2 changes: 1 addition & 1 deletion gen/bobgen-helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ func Types() drivers.Types {
ipAddr := netip.AddrFrom4(addr)
ipPrefix := netip.PrefixFrom(ipAddr, f.IntBetween(0, ipAddr.BitLen()))
return pgtypes.Inet{Prefix: ipPrefix}`,
RandomExprImports: importers.List{`"crypto/rand"`},
RandomExprImports: importers.List{`"crypto/rand"`, `"net/netip"`},
},
"pgtypes.Macaddr": {
Imports: importers.List{`"github.com/stephenafamo/bob/types/pgtypes"`},
Expand Down

0 comments on commit b263af1

Please sign in to comment.