chore(pr)!: consistent naming conventions
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package assert
|
package Assert
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package logger
|
package Logger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package logger
|
package Logger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package logger
|
package Logger
|
||||||
|
|
||||||
// Message format(s)
|
// Message format(s)
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package logger
|
package Logger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package logger
|
package Logger
|
||||||
|
|
||||||
func (lgr *NullLoggerImpl) init() {}
|
func (lgr *NullLoggerImpl) init() {}
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package logger
|
package Logger
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package testing
|
package Testing
|
||||||
|
|
||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package typeutils
|
package Type
|
||||||
|
|
||||||
// Created to abstract over Is_some and Is_ok
|
// Created to abstract over Is_some and Is_ok
|
||||||
type ValueContainer interface {
|
type ValueContainer interface {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
package typeutils
|
package Type
|
||||||
|
|
||||||
import "github.com/lbatuska/goutils/assert"
|
import Assert "github.com/lbatuska/goutils/assert"
|
||||||
|
|
||||||
// CTORS BEGIN
|
// CTORS BEGIN
|
||||||
func Some[T any](value T) Optional[T] {
|
func Some[T any](value T) Optional[T] {
|
||||||
@@ -41,7 +41,7 @@ func (opt *Optional[T]) HasValue() bool {
|
|||||||
|
|
||||||
// UNWRAPPABLE INTERFACE BEGIN
|
// UNWRAPPABLE INTERFACE BEGIN
|
||||||
func (opt *Optional[T]) Expect(msg string) T {
|
func (opt *Optional[T]) Expect(msg string) T {
|
||||||
assert.NotNil(opt)
|
Assert.NotNil(opt)
|
||||||
if opt.present {
|
if opt.present {
|
||||||
return opt.value
|
return opt.value
|
||||||
}
|
}
|
||||||
@@ -49,7 +49,7 @@ func (opt *Optional[T]) Expect(msg string) T {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (opt *Optional[T]) Unwrap() T {
|
func (opt *Optional[T]) Unwrap() T {
|
||||||
assert.NotNil(opt)
|
Assert.NotNil(opt)
|
||||||
if opt.present {
|
if opt.present {
|
||||||
return opt.value
|
return opt.value
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package typeutils
|
package Type
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
||||||
"github.com/lbatuska/goutils/assert"
|
Assert "github.com/lbatuska/goutils/assert"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CTORS BEGIN
|
// CTORS BEGIN
|
||||||
@@ -44,7 +44,7 @@ func (res *Result[T]) HasValue() bool {
|
|||||||
|
|
||||||
// UNWRAPPABLE INTERFACE
|
// UNWRAPPABLE INTERFACE
|
||||||
func (res *Result[T]) Expect(msg string) T {
|
func (res *Result[T]) Expect(msg string) T {
|
||||||
assert.NotNil(res)
|
Assert.NotNil(res)
|
||||||
if res.err == nil {
|
if res.err == nil {
|
||||||
return res.value
|
return res.value
|
||||||
}
|
}
|
||||||
@@ -52,7 +52,7 @@ func (res *Result[T]) Expect(msg string) T {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (res *Result[T]) Unwrap() T {
|
func (res *Result[T]) Unwrap() T {
|
||||||
assert.NotNil(res)
|
Assert.NotNil(res)
|
||||||
if res.err == nil {
|
if res.err == nil {
|
||||||
return res.value
|
return res.value
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package typeutils
|
package Type
|
||||||
|
|
||||||
type Optional[T any] struct {
|
type Optional[T any] struct {
|
||||||
value T
|
value T
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package typeutils
|
package Type
|
||||||
|
|
||||||
func Expect[T any](val Unwrappable[T], msg string) T {
|
func Expect[T any](val Unwrappable[T], msg string) T {
|
||||||
return val.Expect(msg)
|
return val.Expect(msg)
|
||||||
Reference in New Issue
Block a user