Skip to content
Snippets Groups Projects
Commit 2a25eba5 authored by Cornel Rautenbach's avatar Cornel Rautenbach
Browse files

Update module path

parent 6239cac3
Branches
Tags v1.1.1
No related merge requests found
......@@ -29,7 +29,7 @@ For lots of detail on this, see comments in error_formats_test.go and run that t
## Usage
Get the package into your project:
```
go get github.com/uafrica/go-utils
go get gitlab.com/uafrica/go-utils
```
## func New()
......@@ -63,7 +63,7 @@ if err := db.Select(query); err != nil {
Replace all other errors package imports with this package:
```
import (
"github.com/uafrica/go-utils/errors"
"gitlab.com/uafrica/go-utils/errors"
)
```
......@@ -115,7 +115,7 @@ Call ```err.Description()``` to get a struct that can marshal to JSON for a comp
{
"error": "login failed",
"source": {
"package": "github.com/uafrica/go-utils/errors/errors_test",
"package": "gitlab.com/uafrica/go-utils/errors/errors_test",
"file": "errors_test.go",
"line": 18,
"function": "TestErrorFormatting"
......@@ -123,7 +123,7 @@ Call ```err.Description()``` to get a struct that can marshal to JSON for a comp
"cause": {
"error": "failed to find account",
"source": {
"package": "github.com/uafrica/go-utils/errors/errors_test",
"package": "gitlab.com/uafrica/go-utils/errors/errors_test",
"file": "errors_test.go",
"line": 17,
"function": "TestErrorFormatting"
......@@ -131,7 +131,7 @@ Call ```err.Description()``` to get a struct that can marshal to JSON for a comp
"cause": {
"error": "query failed",
"source": {
"package": "github.com/uafrica/go-utils/errors/errors_test",
"package": "gitlab.com/uafrica/go-utils/errors/errors_test",
"file": "errors_test.go",
"line": 16,
"function": "TestErrorFormatting"
......
......@@ -9,7 +9,7 @@ import (
pkg_errors "github.com/pkg/errors"
uf_errors "github.com/uafrica/go-utils/errors"
uf_errors "gitlab.com/uafrica/go-utils/errors"
)
//use this struct to define various types of errors to experiment with
......
......@@ -4,7 +4,7 @@ import (
"encoding/json"
"testing"
"github.com/uafrica/go-utils/errors"
"gitlab.com/uafrica/go-utils/errors"
)
func TestErrorFormatting(t *testing.T) {
......@@ -28,7 +28,7 @@ func TestErrorFormatting(t *testing.T) {
t.Logf("%%v: %v", e4)
//use %+v for complete error with stack:
//-> "github.com/uafrica/go-utils/errors_test/TestErrorFormatting():errors_test.go(17): login failed, because github.com/uafrica/go-utils/errors_test/TestErrorFormatting():errors_test.go(16): failed to find account, because github.com/uafrica/go-utils/errors_test/TestErrorFormatting():errors_test.go(15): query failed, because you have problem in your SQL near xxx
//-> "gitlab.com/uafrica/go-utils/errors_test/TestErrorFormatting():errors_test.go(17): login failed, because gitlab.com/uafrica/go-utils/errors_test/TestErrorFormatting():errors_test.go(16): failed to find account, because gitlab.com/uafrica/go-utils/errors_test/TestErrorFormatting():errors_test.go(15): query failed, because you have problem in your SQL near xxx
t.Logf("%%+v: %+v", e4)
//you may also JSON marshal the error
......
......@@ -4,7 +4,7 @@ import (
"fmt"
"os"
"github.com/uafrica/go-utils/errors"
"gitlab.com/uafrica/go-utils/errors"
)
var logger Logger
......
......@@ -7,7 +7,7 @@ import (
"strings"
"time"
"github.com/uafrica/go-utils/errors"
"gitlab.com/uafrica/go-utils/errors"
)
type ILogger interface {
......
......@@ -4,8 +4,8 @@ import (
"os"
"testing"
"github.com/uafrica/go-utils/errors"
"github.com/uafrica/go-utils/logger"
"gitlab.com/uafrica/go-utils/errors"
"gitlab.com/uafrica/go-utils/logger"
)
func TestLogs(t *testing.T) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment