I think this tool just needs to be replaced from what to what.
For example this looks like this
goreplacepkg -from
k8s.io/apimachinery/pkg/util/diff.{ObjectDiff,ObjectGoPrintDiff,ObjectGoPrintDiff}
-to github.com/google/go-cmp/cmp.Diff
goreplacepkg -from ioutil.ReadAll -to io.ReadAll
Here
https://k8s.io/apimachinery/pkg/util/diff?go-get=1
He needs to add parameters to be able to access
https://github.com/kubernetes/apimachinery/blob/master/pkg/util/diff/diff.go#L57
This is his path to realization
在2022年11月1日星期二 UTC+8 12:41:22 写道:
> On Mon, Oct 31, 2022 at 8:27 PM mr@gmail.co
On Mon, Oct 31, 2022 at 8:27 PM mr@gmail.com wrote:
> Yes, it is very rare, but it can be encountered, and once encountered his
> workload will be a lot of
>
> github.com/pkg/errors > std.errors
> ioutil.TempDir => os.MkdirTemp
> ioutil.ReadAll => io.ReadAll
>
You seem to agree with me that
Yes, it is very rare, but it can be encountered, and once encountered his
workload will be a lot of
github.com/pkg/errors > std.errors
ioutil.TempDir => os.MkdirTemp
ioutil.ReadAll => io.ReadAll
在2022年10月31日星期一 UTC+8 10:52:45 写道:
> I'm curious how often you perform such refactoring? In my e
I'm curious how often you perform such refactoring? In my experience such
changes are extremely rare and usually require other changes due to
differences in the API of the two third-party packages . Which means, in my
experience, expending effort to automate such import rewrites typically
requires
He doesn't get the job done.
在2022年10月22日星期六 UTC+8 06:20:53 写道:
> try https://pkg.go.dev/golang.org/x/tools/cmd/gomvpkg
>
>
> On Friday, 21 October 2022 at 16:58:57 UTC+1 mr@gmail.com wrote:
>
>> I'm looking for a tool like this, I've searched google and github and
>> can't find one, have yo
try https://pkg.go.dev/golang.org/x/tools/cmd/gomvpkg
On Friday, 21 October 2022 at 16:58:57 UTC+1 mr@gmail.com wrote:
> I'm looking for a tool like this, I've searched google and github and
> can't find one, have you guys used such a tool?
>
> I use a method like this in my code
>
> k8s.io