diff --git a/helpers/helpers_test.go b/helpers/helpers_test.go index 1cf66a2..036e338 100644 --- a/helpers/helpers_test.go +++ b/helpers/helpers_test.go @@ -110,7 +110,7 @@ func TestPipe(t *testing.T) { // pipe functions pipe2 := Pipe( func(foo *foo) *foo { - foo.Name = "bar" + foo.Name = "bar" // nolint:goconst return foo }, func(foo *foo) *foo { diff --git a/values/proxy.go b/helpers/proxy_value.go similarity index 98% rename from values/proxy.go rename to helpers/proxy_value.go index 5dabbc0..124186b 100644 --- a/values/proxy.go +++ b/helpers/proxy_value.go @@ -1,4 +1,4 @@ -package values +package helpers type Proxy[T any] struct { value T diff --git a/values/proxy_test.go b/helpers/proxy_value_test.go similarity index 99% rename from values/proxy_test.go rename to helpers/proxy_value_test.go index 1977381..5d9fe4e 100644 --- a/values/proxy_test.go +++ b/helpers/proxy_value_test.go @@ -1,4 +1,4 @@ -package values +package helpers import ( "testing" diff --git a/values/values.go b/helpers/values.go similarity index 99% rename from values/values.go rename to helpers/values.go index fd62ae1..cc71685 100644 --- a/values/values.go +++ b/helpers/values.go @@ -1,4 +1,4 @@ -package values +package helpers // If returns trueVal if condition is true, otherwise falseVal. // diff --git a/values/values_test.go b/helpers/values_test.go similarity index 99% rename from values/values_test.go rename to helpers/values_test.go index 792c7fa..6950644 100644 --- a/values/values_test.go +++ b/helpers/values_test.go @@ -1,4 +1,4 @@ -package values +package helpers import ( "errors" @@ -9,11 +9,6 @@ import ( "github.com/stretchr/testify/assert" ) -type foo struct { - Name string - Age int -} - func TestTap_Struct(t *testing.T) { f := &foo{Name: "foo"} diff --git a/ptr/ptr.go b/ptr/ptr.go index 8046d53..3e22937 100644 --- a/ptr/ptr.go +++ b/ptr/ptr.go @@ -1,111 +1,111 @@ -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. package ptr import ( "time" ) -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func String(s string) *string { return &s } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Bool(b bool) *bool { return &b } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Int(i int) *int { return &i } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Int8(i int8) *int8 { return &i } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Int16(i int16) *int16 { return &i } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Int32(i int32) *int32 { return &i } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Int64(i int64) *int64 { return &i } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Uint(u uint) *uint { return &u } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Uint8(u uint8) *uint8 { return &u } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Uint16(u uint16) *uint16 { return &u } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Uint32(u uint32) *uint32 { return &u } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Uint64(u uint64) *uint64 { return &u } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Float32(f float32) *float32 { return &f } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Float64(f float64) *float64 { return &f } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Complex64(c complex64) *complex64 { return &c } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Complex128(c complex128) *complex128 { return &c } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Byte(b byte) *byte { return &b } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Rune(r rune) *rune { return &r } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Uintptr(u uintptr) *uintptr { return &u } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Time(t time.Time) *time.Time { return &t } -// Deprecated: Use values.Ptr instead. +// Deprecated: Use helpers.Ptr instead. func Duration(d time.Duration) *time.Duration { return &d } diff --git a/ptr/unptr.go b/ptr/unptr.go index 41abf86..265dcf6 100644 --- a/ptr/unptr.go +++ b/ptr/unptr.go @@ -2,7 +2,7 @@ package ptr import "time" -// Deprecated: Use values.Val instead.// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead.// Deprecated: Use helpers.Val instead. func UnString(s *string) (string, bool) { if s == nil { return "", false @@ -10,7 +10,7 @@ func UnString(s *string) (string, bool) { return *s, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnBool(b *bool) (bool, bool) { if b == nil { return false, false @@ -18,7 +18,7 @@ func UnBool(b *bool) (bool, bool) { return *b, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnInt(i *int) (int, bool) { if i == nil { return 0, false @@ -26,7 +26,7 @@ func UnInt(i *int) (int, bool) { return *i, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnInt8(i *int8) (int8, bool) { if i == nil { return 0, false @@ -34,7 +34,7 @@ func UnInt8(i *int8) (int8, bool) { return *i, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnInt16(i *int16) (int16, bool) { if i == nil { return 0, false @@ -42,7 +42,7 @@ func UnInt16(i *int16) (int16, bool) { return *i, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnInt32(i *int32) (int32, bool) { if i == nil { return 0, false @@ -50,7 +50,7 @@ func UnInt32(i *int32) (int32, bool) { return *i, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnInt64(i *int64) (int64, bool) { if i == nil { return 0, false @@ -58,7 +58,7 @@ func UnInt64(i *int64) (int64, bool) { return *i, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnUint(u *uint) (uint, bool) { if u == nil { return 0, false @@ -66,7 +66,7 @@ func UnUint(u *uint) (uint, bool) { return *u, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnUint8(u *uint8) (uint8, bool) { if u == nil { return 0, false @@ -74,7 +74,7 @@ func UnUint8(u *uint8) (uint8, bool) { return *u, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnUint16(u *uint16) (uint16, bool) { if u == nil { return 0, false @@ -82,7 +82,7 @@ func UnUint16(u *uint16) (uint16, bool) { return *u, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnUint32(u *uint32) (uint32, bool) { if u == nil { return 0, false @@ -90,7 +90,7 @@ func UnUint32(u *uint32) (uint32, bool) { return *u, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnUint64(u *uint64) (uint64, bool) { if u == nil { return 0, false @@ -98,7 +98,7 @@ func UnUint64(u *uint64) (uint64, bool) { return *u, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnFloat32(f *float32) (float32, bool) { if f == nil { return 0, false @@ -106,7 +106,7 @@ func UnFloat32(f *float32) (float32, bool) { return *f, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnFloat64(f *float64) (float64, bool) { if f == nil { return 0, false @@ -114,7 +114,7 @@ func UnFloat64(f *float64) (float64, bool) { return *f, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnComplex64(c *complex64) (complex64, bool) { if c == nil { return 0, false @@ -122,7 +122,7 @@ func UnComplex64(c *complex64) (complex64, bool) { return *c, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnComplex128(c *complex128) (complex128, bool) { if c == nil { return 0, false @@ -130,7 +130,7 @@ func UnComplex128(c *complex128) (complex128, bool) { return *c, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnByte(b *byte) (byte, bool) { if b == nil { return 0, false @@ -138,7 +138,7 @@ func UnByte(b *byte) (byte, bool) { return *b, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnRune(r *rune) (rune, bool) { if r == nil { return 0, false @@ -146,7 +146,7 @@ func UnRune(r *rune) (rune, bool) { return *r, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnUintptr(u *uintptr) (uintptr, bool) { if u == nil { return 0, false @@ -154,7 +154,7 @@ func UnUintptr(u *uintptr) (uintptr, bool) { return *u, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnTime(t *time.Time) (time.Time, bool) { if t == nil { return time.Time{}, false @@ -162,7 +162,7 @@ func UnTime(t *time.Time) (time.Time, bool) { return *t, true } -// Deprecated: Use values.Val instead. +// Deprecated: Use helpers.Val instead. func UnDuration(d *time.Duration) (time.Duration, bool) { if d == nil { return 0, false