Golang testing

From wikinotes
Revision as of 20:23, 23 May 2022 by Will (talk | contribs) (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, "...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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"