google / go-cmp

Package for comparing Go values in tests
BSD 3-Clause "New" or "Revised" License
4.08k stars 209 forks source link

Package Name Mismatches #349

Closed pcfreak30 closed 6 months ago

pcfreak30 commented 6 months ago

I find this odd since it seems to have been this way for a while, but Go has issues fetching the package since the go.mod name go-cmp and the actual name cmp aren't the same, forcing you to probably need to fork.

neild commented 6 months ago

I don't understand the report here. What names aren't the same? What do you mean by "need to fork"?

dsnet commented 6 months ago

The module name is go-cmp, but the package name is named cmp. Note that the package itself is nested one level under the module root as github.com/google/go-cmp/cmp. So at least the import path and the package name as consistent. There is no rule in Go that modules and package contained within have to have the same or related names. It is odd when the import path name mismatches the package name, but that's not the case here.

pcfreak30 commented 6 months ago

Thanks, it's the 1st time I've seen this, and I already made my version fixing it based on my experience. I will see if I can get it properly working and delete my fork if so.

neild commented 6 months ago

Thanks. I don't believe there's any issue here. The package name is github.com/google/go-cmp/cmp.