gpt4 book ai didi

golang gofmt 包重写通配符

转载 作者:IT王子 更新时间:2023-10-29 01:48:36 25 4
gpt4 key购买 nike

我正在尝试做 gofmt重写以特定前缀开头的所有包。像这样的东西:

gofmt -r 'github.com/some/path/<wildcard> -> someotherrepo.com/some/path/<wildcard>'

显然 wildcard不是有效的语法,只是展示了这个概念。我试过使用单个小写字符,但这在这里不起作用。

是否可以用 gofmt 做我正在尝试的事情? ?

最佳答案

这是 gofmt 命令页面所说的

Given a file, it operates on that file; given a directory, it operates on all .go files
in that directory, recursively

https://golang.org/cmd/gofmt/

关于golang gofmt 包重写通配符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36782937/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com