code_registry

command
v0.0.0-...-ad9b26c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 26, 2024 License: MIT Imports: 12 Imported by: 0

README

这个程序是用来自动生成错误代码注册的代码程序,在使用的时候编译成可执行文件,用该工具命令启动执行即可(test是测试的状态目录) 需要注册的文件只能支持在var中批量定义的常量,暂不支持其他的内容

package code

import "gitee.com/tylf2018/go-micro-framework/pkg/code"

var (
	InterError1 = code.NewWithCodeAndMessage(101, "InterError")
	InterError2 = code.NewWithCodeAndMessage(102, "InterError")
	InterError3 = code.NewWithCodeAndMessage(103, "InterError")
	InterError4 = code.NewWithCodeAndMessage(104, "InterError")
	InterError5 = code.NewWithCodeAndMessage(105, "InterError")
	InterError7 = code.NewWithCodeAndMessage(106, "InterError")
)

使用方法如下:

cd \go-micro-framework\tools\code_registry #根据自己的路径来
go build  -o code_init_gen main.go
./code_init_gen -n=./test/code.go -m=false

上面命令生成的文件会在和指定路径一个文件夹下面

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL