我拿这代码测了没问题啊。是不是模块路径有问题,按你的项目结构,主包的名字应该是 geometry,不该是 third_xxxx,贴一下 go.mod 。
rectangle package initialized
main package initialized
Geometrical shape properties
area of rectangle 42.00
diagonal of the rectangle 9.22 %
【 在 feng321 的大作中提到: 】
: 这个是rectprops.go
: // rectprops.go
: package rectangle
: ...................
--
FROM 115.193.174.*