AI写作智能体 自主规划任务,支持联网查询和网页读取,多模态高效创作各类分析报告、商业计划、营销方案、教学内容等。 广告
[TOC] > https://github.com/smartystreets/goconvey ## 概述 ![](https://img.kancloud.cn/c8/6f/c86f6799ab699b7ff8dac257d9097020_2874x1446.png) ## 安装 1. 安装命令行 ``` go install github.com/smartystreets/goconvey ``` 2. 项目中安装 ``` go get github.com/smartystreets/goconvey ``` ## 示例 ``` package package_name import ( "testing" . "github.com/smartystreets/goconvey/convey" ) func TestSpec(t *testing.T) { // Only pass t into top-level Convey calls Convey("Given some integer with a starting value", t, func() { x := 1 Convey("When the integer is incremented", func() { x++ Convey("The value should be greater by one", func() { So(x, ShouldEqual, 2) }) }) }) } ``` 在项目中执行,执行结果就可以在网页中查看 ``` $GOPATH/bin/goconvey ```