assert

package
v0.0.0-...-10ffd4c Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2020 License: MIT, MIT Imports: 0 Imported by: 0

README

testify/assert

github.com/testify/assert弥补了golang没有assert关键字的缺憾。

关键点

  1. 每一个assert函数,都使用testing.T对象作为第一个参数,以此来输出错误信息。这样可以保证对go test的兼容性
  2. 每一个assert函数,都会根据断言成功与否来返回一个bool值,这样有利于做进一步的断言。

更多要点

请参考assert的GoDoc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a, b int) int

Add 是加法

func Sub

func Sub(a, b int) int

Sub 是减法

Types

This section is empty.

Jump to

Keyboard shortcuts

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