Skip to content

Commit

Permalink
Merge pull request #14 from lefinal/add-exhaustruct-tags
Browse files Browse the repository at this point in the history
feat: allow easier usage of exhaustruct linter
  • Loading branch information
lefinal authored Feb 2, 2024
2 parents a59c151 + d3c0726 commit 71da889
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// Bool holds a nullable boolean value.
type Bool struct {
// Bool is the actual boolean value when Valid.
Bool bool
Bool bool `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion byte_slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// ByteSlice holds a nullable byte slice.
type ByteSlice struct {
// ByteSlice is the actual byte slice when Valid.
ByteSlice []byte
ByteSlice []byte `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion float32.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// Float32 holds a nullable float32.
type Float32 struct {
// Float32 is the actual value when Valid.
Float32 float32
Float32 float32 `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion float64.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// Float64 holds a nullable float64.
type Float64 struct {
// Float64 is the actual value when Valid.
Float64 float64
Float64 float64 `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion int.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// Int holds a nullable int.
type Int struct {
// Int is the actual value when Valid.
Int int
Int int `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion int16.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// Int16 holds a nullable int16.
type Int16 struct {
// Int16 is the actual value when Valid.
Int16 int16
Int16 int16 `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion int32.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// Int32 holds a nullable int32.
type Int32 struct {
// Int32 is the actual value when Valid.
Int32 int32
Int32 int32 `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion int64.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// Int64 holds a nullable int64.
type Int64 struct {
// Int64 is the actual value when Valid.
Int64 int64
Int64 int64 `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion json_nullable.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// (un)marshallable. However, it cannot be used as sql.Scanner or driver.Valuer.
type JSONNullable[T any] struct {
// V is the actual value when Valid.
V T
V T `exhaustruct:"optional"`
// Valid describes whether the JSONNullable does not hold a NULL value.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion json_raw_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// value will be represented with Valid being false.
type JSONRawMessage struct {
// RawMessage is the actual json.RawMessage when Valid.
RawMessage json.RawMessage
RawMessage json.RawMessage `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion nullable.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type NullableValue interface {
// Nullable holds a nullable value.
type Nullable[T NullableValue] struct {
// V is the actual value when Valid.
V T
V T `exhaustruct:"optional"`
// Valid describes whether the Nullable does not hold a NULL value.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion nullable_into.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type NullableIntoValue[T any] interface {
// reference.
type NullableInto[T NullableIntoValue[T]] struct {
// V is the actual value when Valid.
V T
V T `exhaustruct:"optional"`
// Valid describes whether the Nullable does not hold a NULL value.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion optional.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// NullableInto if database support is not required.
type Optional[T any] struct {
// V is the actual value when Valid.
V T
V T `exhaustruct:"optional"`
// Valid describes whether the Nullable does not hold a NULL value.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion string.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// String holds a nullable string.
type String struct {
// String is the actual value when Valid.
String string
String string `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down
2 changes: 1 addition & 1 deletion time.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
// Time holds a nullable time.Time.
type Time struct {
// Time is the actual value when Valid.
Time time.Time
Time time.Time `exhaustruct:"optional"`
// Valid when no NULL-value is represented.
Valid bool
}
Expand Down

0 comments on commit 71da889

Please sign in to comment.