Skip to content

Commit 1389e08

Browse files
authored
[-] transfer ownership to naughty gopher (#7)
1 parent 1c896ca commit 1389e08

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Kamaleshwar
3+
Copyright (c) 2024 Naughty Gopher
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<p align="center"><img src="https://user-images.githubusercontent.com/1092882/87815217-d864a680-c882-11ea-9c94-24b67f7125fe.png" alt="errors gopher" width="256px"/></p>
22

3-
[![](https://github.com/bnkamalesh/errors/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/bnkamalesh/errors/actions)
4-
[![Go Reference](https://pkg.go.dev/badge/github.com/bnkamalesh/errors.svg)](https://pkg.go.dev/github.com/bnkamalesh/errors)
5-
[![Go Report Card](https://goreportcard.com/badge/github.com/bnkamalesh/errors)](https://goreportcard.com/report/github.com/bnkamalesh/errors)
6-
[![codecov](https://codecov.io/gh/bnkamalesh/errors/branch/master/graph/badge.svg)](https://codecov.io/gh/bnkamalesh/errors)
3+
[![](https://github.com/naughtygopher/errors/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/naughtygopher/errors/actions)
4+
[![Go Reference](https://pkg.go.dev/badge/github.com/naughtygopher/errors.svg)](https://pkg.go.dev/github.com/naughtygopher/errors)
5+
[![Go Report Card](https://goreportcard.com/badge/github.com/naughtygopher/errors)](https://goreportcard.com/report/github.com/naughtygopher/errors)
6+
[![codecov](https://codecov.io/gh/naughtygopher/errors/branch/master/graph/badge.svg)](https://codecov.io/gh/naughtygopher/errors)
77
[![](https://awesome.re/mentioned-badge.svg)](https://github.com/avelino/awesome-go#error-handling)
88

99
# Errors v0.10.0
@@ -46,7 +46,7 @@ Go 1.13+
4646
Helper functions are available for all the error types. Each of them have 2 helper functions, one which accepts only a string,
4747
and the other which accepts an original error as well as a user friendly message.
4848

49-
All the dedicated error type functions are documented [here](https://pkg.go.dev/github.com/bnkamalesh/errors?tab=doc#DownstreamDependencyTimedout).
49+
All the dedicated error type functions are documented [here](https://pkg.go.dev/github.com/naughtygopher/errors?tab=doc#DownstreamDependencyTimedout).
5050
Names are consistent with the error type, e.g. errors.Internal(string) and errors.InternalErr(error, string)
5151

5252
### User friendly messages
@@ -63,7 +63,7 @@ package main
6363
import (
6464
"fmt"
6565

66-
"github.com/bnkamalesh/errors"
66+
"github.com/naughtygopher/errors"
6767
)
6868

6969
func Bar() error {
@@ -99,10 +99,10 @@ Output
9999
```
100100
err: bar is not happy
101101
102-
err.Error(): /Users/k.balakumaran/go/src/github.com/bnkamalesh/errors/cmd/main.go:16: bar is not happy
102+
err.Error(): /Users/k.balakumaran/go/src/github.com/naughtygopher/errors/cmd/main.go:16: bar is not happy
103103
hello world!bar is not happy
104104
105-
formatted +v: /Users/k.balakumaran/go/src/github.com/bnkamalesh/errors/cmd/main.go:16: bar is not happy
105+
formatted +v: /Users/k.balakumaran/go/src/github.com/naughtygopher/errors/cmd/main.go:16: bar is not happy
106106
hello world!bar is not happy
107107
108108
formatted v: bar is not happy
@@ -136,9 +136,9 @@ import (
136136
"net/http"
137137
"time"
138138

139-
"github.com/bnkamalesh/errors"
140-
"github.com/bnkamalesh/webgo/v6"
141-
"github.com/bnkamalesh/webgo/v6/middleware/accesslog"
139+
"github.com/naughtygopher/errors"
140+
"github.com/naughtygopher/webgo/v6"
141+
"github.com/naughtygopher/webgo/v6/middleware/accesslog"
142142
)
143143

144144
func bar() error {
@@ -202,7 +202,7 @@ func main() {
202202
}
203203
```
204204

205-
[webgo](https://github.com/bnkamalesh/webgo) was used to illustrate the usage of the function, `errors.HTTPStatusCodeMessage`. It returns the appropriate http status code, user friendly message stored within, and a boolean value. Boolean value is `true` if the returned error of type \*Error.
205+
[webgo](https://github.com/naughtygopher/webgo) was used to illustrate the usage of the function, `errors.HTTPStatusCodeMessage`. It returns the appropriate http status code, user friendly message stored within, and a boolean value. Boolean value is `true` if the returned error of type \*Error.
206206
Since we get the status code and message separately, when using any web framework, you can set values according to the respective framework's native functions. In case of Webgo, it wraps errors in a struct of its own. Otherwise, you could directly respond to the HTTP request by calling `errors.WriteHTTP(error,http.ResponseWriter)`.
207207

208208
Once the app is running, you can check the response by opening `http://localhost:8080` on your browser. Or on terminal
@@ -229,7 +229,7 @@ go version go1.19.5 darwin/amd64
229229
$ go test -benchmem -bench .
230230
goos: darwin
231231
goarch: amd64
232-
pkg: github.com/bnkamalesh/errors
232+
pkg: github.com/naughtygopher/errors
233233
cpu: Intel(R) Core(TM) i7-1068NG7 CPU @ 2.30GHz
234234
Benchmark_Internal-8 1526194 748.8 ns/op 1104 B/op 2 allocs/op
235235
Benchmark_Internalf-8 1281465 944.0 ns/op 1128 B/op 3 allocs/op
@@ -241,7 +241,7 @@ Benchmark_InternalGetMessageWithNestedError-8 1362092 886.3 ns/op
241241
Benchmark_HTTPStatusCodeMessage-8 27494096 41.38 ns/op 16 B/op 1 allocs/op
242242
BenchmarkHasType-8 100000000 10.50 ns/op 0 B/op 0 allocs/op
243243
PASS
244-
ok github.com/bnkamalesh/errors 15.006s
244+
ok github.com/naughtygopher/errors 15.006s
245245
```
246246

247247
## Contributing

errors_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func TestStacktraceCustomFormat(t *testing.T) {
179179
msgFormat := "message: %m#"
180180
traceFormat := "function: %f|"
181181
got := StacktraceCustomFormat(msgFormat, traceFormat, e)
182-
want := "message: wrapped error#function: github.com/bnkamalesh/errors.TestStacktraceCustomFormat|function: testing.tRunner|message: original error#"
182+
want := "message: wrapped error#function: github.com/naughtygopher/errors.TestStacktraceCustomFormat|function: testing.tRunner|message: original error#"
183183
if got != want {
184184
t.Errorf("StacktraceCustomFormat() = %v\nwant %v", got, want)
185185
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
module github.com/bnkamalesh/errors
1+
module github.com/naughtygopher/errors
22

33
go 1.19

0 commit comments

Comments
 (0)