Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save foreversmart/b5c66832d872aee5b44a66b61d1ccbe0 to your computer and use it in GitHub Desktop.
Save foreversmart/b5c66832d872aee5b44a66b61d1ccbe0 to your computer and use it in GitHub Desktop.
正则替换 type 为 某 package 下的 alias
// params struct 调整为 common 包的alias
type (\w+) struct \{\n([,/|\[\]\s\w\*\(\)\?`:".-]+)\n\}
type $1 = common.$1
// params string 调整为 common 包的alias
type (\w+) string
type $1 = common.$1
// params int 调整为 common 包的alias
type (\w+) int
type $1 = common.$1
// 字符串枚举类型 调整为 common 包的 alias
^\s(\w+)\s+(\w+) = "\w+"
type $1 = common.$1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment