본문 바로가기
Go/Packages

[Go] Package testing

by llHoYall 2020. 11. 30.

Package testing provides support for automated testing of Go packages.

Methods

Error

Error is equivalent to Log() followed by Fail().

func (c *T) Error(args ...interface{})

Errorf

Errorf is equivalent to Logf() followed by Fail().

func (c *T) Errorf(format string, args ...interface{})

Usage

package main

import "testing"

func TestFunction(t *testing.T) {
  t.Error("Test Failed")
}

'Go > Packages' 카테고리의 다른 글

[Go] Package fmt  (0) 2021.10.04
[Go] Package os  (0) 2020.12.02
[Go] Package log  (0) 2020.11.30
[Go] Package bufio  (0) 2020.10.31
[Go] Package errors  (0) 2020.10.29

댓글