Skip to content

Commit

Permalink
readme: add struct definition example
Browse files Browse the repository at this point in the history
  • Loading branch information
toru committed Apr 27, 2023
1 parent b92ced5 commit 060e804
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,18 @@ Here is the [full documentation](https://pkg.go.dev/github.com/toru/nullable).

## Quick Examples

Usage within struct definition.

```go
type IceCream struct {
// Using the nullable package.
Flavor nullable.String `db:"flavor"`

// Using the database/sql package.
Topping sql.NullString `db:"topping"`
}
```

Here is an example using the String type.

```go
Expand Down

0 comments on commit 060e804

Please sign in to comment.