github.com/gogf/gf@v1.16.9/errors/gcode/gcode_test.go (about) 1 // Copyright GoFrame Author(https://goframe.org). All Rights Reserved. 2 // 3 // This Source Code Form is subject to the terms of the MIT License. 4 // If a copy of the MIT was not distributed with this file, 5 // You can obtain one at https://github.com/gogf/gf. 6 7 package gcode_test 8 9 import ( 10 "github.com/gogf/gf/errors/gcode" 11 "testing" 12 13 "github.com/gogf/gf/test/gtest" 14 ) 15 16 func Test_Nil(t *testing.T) { 17 gtest.C(t, func(t *gtest.T) { 18 c := gcode.New(1, "custom error", "detailed description") 19 t.Assert(c.Code(), 1) 20 t.Assert(c.Message(), "custom error") 21 t.Assert(c.Detail(), "detailed description") 22 }) 23 }