github.com/reiver/go-fck -> sourcecode.social/reiver/go-erorr

master
Charles Iliya Krempeaux 2023-09-23 04:46:12 +09:00
parent f43373f199
commit 52635729b3
4 changed files with 14 additions and 12 deletions

View File

@ -1,24 +1,26 @@
# go-fck # go-erorr
Package **fck** implements tools to create and manipulate errors. Package **erorr** implements tools to create and manipulate errors.
(This package used to be called "fck".)
## Documention ## Documention
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-fck Online documentation, which includes examples, can be found at: http://godoc.org/sourcecode.social/reiver/go-erorr
[![GoDoc](https://godoc.org/github.com/reiver/go-fck?status.svg)](https://godoc.org/github.com/reiver/go-fck) [![GoDoc](https://godoc.org/sourcecode.social/reiver/go-erorr?status.svg)](https://godoc.org/sourcecode.social/reiver/go-erorr)
## Creating Errors ## Creating Errors
There are two ways to create errors — There are two ways to create errors —
With `fck.Error`: With `erorr.Error`:
``` ```
const err error = fck.Error("internal-error") const err error = erorr.Error("internal-error")
``` ```
And with `fck.Errorf`: And with `erorr.Errorf`:
``` ```
var err error = fck.Errorf("bad value for id %q", id) var err error = erorr.Errorf("bad value for id %q", id)
``` ```
**One thing to notice is that `fck.Error` errors can be a Go `const`.** **One thing to notice is that `erorr.Error` errors can be a Go `const`.**

View File

@ -1,4 +1,4 @@
package fck package erorr
type Error string type Error string

View File

@ -1,4 +1,4 @@
package fck package erorr
import ( import (
"fmt" "fmt"

2
go.mod
View File

@ -1,3 +1,3 @@
module github.com/reiver/go-fck module sourcecode.social/reiver/go-erorr
go 1.17 go 1.17