lab002

command
v0.0.0-...-f10d331 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 1 Imported by: 0

README

example02

注意点

  • 使用mockgen命令:mockgen.exe -destination spider/mock_spider.go -package spider -source spider\spider.go, -destination指定要生成的文件,-package指定生成文件的包名,-source是指对哪个文件mock
  • mockSpider.EXPECT().GetBody().Return("go1.8.3")指定了这个方法的返回

参考资料

运行结果

Imgur

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package spider is a generated GoMock package.
Package spider is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL