mirror of
https://github.com/zitadel/zitadel
synced 2024-11-22 00:39:36 +00:00
25ef3da9d5
chore(fmt): run gci on complete project Fix global import formatting in go code by running the `gci` command. This allows us to just use the command directly, instead of fixing the import order manually for the linter, on each PR. Co-authored-by: Elio Bischof <elio@zitadel.com>
20 lines
454 B
Go
20 lines
454 B
Go
package zerrors_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"github.com/zitadel/zitadel/internal/zerrors"
|
|
)
|
|
|
|
func TestErrorMethod(t *testing.T) {
|
|
err := zerrors.ThrowError(nil, "id", "msg")
|
|
expected := "ID=id Message=msg"
|
|
assert.Equal(t, expected, err.Error())
|
|
|
|
err = zerrors.ThrowError(err, "subID", "subMsg")
|
|
subExptected := "ID=subID Message=subMsg Parent=(ID=id Message=msg)"
|
|
assert.Equal(t, subExptected, err.Error())
|
|
}
|