Golang testing: Difference between revisions

From wikinotes
(Created page with "Go ships with a test suite. = Example = <blockquote> {{ TODO | finish }} <syntaxhighlight lang="go"> package mypackage func Hello(name string) string { return "Hello, "...")
(No difference)

Revision as of 20:23, 23 May 2022

Go ships with a test suite.

Example

TODO:

finish

package mypackage

func Hello(name string) string {
    return "Hello, " + name
}
// myproject/mypackage/mylib_test.go
package mypackage

import "testing"