Skip to content

Commit 3dd08b7

Browse files
author
Dean Karn
authored
fix namespace mistakes violating pattern (#13)
1 parent 6c2e831 commit 3dd08b7

File tree

9 files changed

+21
-20
lines changed

9 files changed

+21
-20
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# pkg
22

3-
![Project status](https://img.shields.io/badge/version-5.5.0-green.svg)
3+
![Project status](https://img.shields.io/badge/version-5.5.1-green.svg)
44
[![Build Status](https://travis-ci.org/go-playground/pkg.svg?branch=master)](https://travis-ci.org/go-playground/pkg)
55
[![Coverage Status](https://coveralls.io/repos/github/go-playground/pkg/badge.svg?branch=master)](https://coveralls.io/github/go-playground/pkg?branch=master)
66
[![GoDoc](https://godoc.org/github.com/go-playground/pkg?status.svg)](https://pkg.go.dev/mod/github.com/go-playground/pkg/v5)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module github.com/go-playground/pkg/v5
22

33
require (
4-
github.com/go-playground/assert/v2 v2.0.1
4+
github.com/go-playground/assert/v2 v2.2.0
55
github.com/go-playground/form/v4 v4.2.0
66
)
77

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
22
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
3+
github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s=
4+
github.com/go-playground/assert/v2 v2.2.0/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
35
github.com/go-playground/form/v4 v4.2.0 h1:N1wh+Goz61e6w66vo8vJkQt+uwZSoLz50kZPJWR8eic=
46
github.com/go-playground/form/v4 v4.2.0/go.mod h1:q1a2BY+AQUUzhl6xA/6hBetay6dEIhMHjgvJiGo6K7U=

sync/mutex.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
//go:build go1.18
22

3-
package sync
3+
package syncext
44

55
import (
66
"sync"
77

8-
"github.com/go-playground/pkg/v5/values/result"
8+
resultext "github.com/go-playground/pkg/v5/values/result"
99
)
1010

1111
// NewMutex creates a new Mutex for use.
@@ -45,11 +45,11 @@ func (m *Mutex[T]) Unlock() {
4545

4646
// TryLock tries to lock Mutex and reports whether it succeeded.
4747
// If it does the value is returned for use in the Ok result otherwise Err with empty value.
48-
func (m *Mutex[T]) TryLock() result.Result[T, struct{}] {
48+
func (m *Mutex[T]) TryLock() resultext.Result[T, struct{}] {
4949
if m.m.TryLock() {
50-
return result.Ok[T, struct{}](m.value)
50+
return resultext.Ok[T, struct{}](m.value)
5151
} else {
52-
return result.Err[T, struct{}](struct{}{})
52+
return resultext.Err[T, struct{}](struct{}{})
5353
}
5454
}
5555

@@ -89,11 +89,11 @@ func (m *RWMutex[T]) Unlock() {
8989

9090
// TryLock tries to lock RWMutex and returns the value in the Ok result if successful.
9191
// If it does the value is returned for use in the Ok result otherwise Err with empty value.
92-
func (m *RWMutex[T]) TryLock() result.Result[T, struct{}] {
92+
func (m *RWMutex[T]) TryLock() resultext.Result[T, struct{}] {
9393
if m.rw.TryLock() {
94-
return result.Ok[T, struct{}](m.value)
94+
return resultext.Ok[T, struct{}](m.value)
9595
} else {
96-
return result.Err[T, struct{}](struct{}{})
96+
return resultext.Err[T, struct{}](struct{}{})
9797
}
9898
}
9999

@@ -121,10 +121,10 @@ func (m *RWMutex[T]) RUnlock() {
121121

122122
// TryRLock tries to lock RWMutex for reading and returns the value in the Ok result if successful.
123123
// If it does the value is returned for use in the Ok result otherwise Err with empty value.
124-
func (m *RWMutex[T]) TryRLock() result.Result[T, struct{}] {
124+
func (m *RWMutex[T]) TryRLock() resultext.Result[T, struct{}] {
125125
if m.rw.TryRLock() {
126-
return result.Ok[T, struct{}](m.value)
126+
return resultext.Ok[T, struct{}](m.value)
127127
} else {
128-
return result.Err[T, struct{}](struct{}{})
128+
return resultext.Err[T, struct{}](struct{}{})
129129
}
130130
}

sync/mutex_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//go:build go1.18
22

3-
package sync
3+
package syncext
44

55
import (
66
"testing"

values/option/option.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build go1.18
22
// +build go1.18
33

4-
package option
4+
package optionext
55

66
import (
77
"database/sql"
@@ -16,8 +16,7 @@ import (
1616
//
1717
// nil is usually used on Go however this has two problems:
1818
// 1. Checking if the return values is nil is NOT enforced and can lead to panics.
19-
// 2. Using nil is not good enough when nil itself is a valid values.
20-
//
19+
// 2. Using nil is not good enough when nil itself is a valid value.
2120
type Option[T any] struct {
2221
value T
2322
isSome bool

values/option/option_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build go1.18
22
// +build go1.18
33

4-
package option
4+
package optionext
55

66
import (
77
"encoding/json"

values/result/result.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build go1.18
22
// +build go1.18
33

4-
package result
4+
package resultext
55

66
// Result represents the result of an operation that is successful or not.
77
type Result[T, E any] struct {

values/result/result_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//go:build go1.18
22
// +build go1.18
33

4-
package result
4+
package resultext
55

66
import (
77
"errors"

0 commit comments

Comments
 (0)