Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

go-testfunc(7) [debian man page]

GO-TESTFUNC(7)						 Miscellaneous Information Manual					    GO-TESTFUNC(7)

NAME
go - tool for managing Go source code DESCRIPTION
The 'go test' command expects to find test, benchmark, and example functions in the "*_test.go" files corresponding to the package under test. A test function is one named TestXXX (where XXX is any alphanumeric string not starting with a lower case letter) and should have the sig- nature, func TestXXX(t *testing.T) { ... } A benchmark function is one named BenchmarkXXX and should have the signature, func BenchmarkXXX(b *testing.B) { ... } An example function is similar to a test function but, instead of using *testing.T to report success or failure, prints output to os.Stdout and os.Stderr. That output is compared against the function's "Output:" comment, which must be the last comment in the function body (see example below). An example with no such comment, or with no text after "Output:" is compiled but not executed. Godoc displays the body of ExampleXXX to demonstrate the use of the function, constant, or variable XXX. An example of a method M with receiver type T or *T is named ExampleT_M. There may be multiple examples for a given function, constant, or variable, distinguished by a trailing _xxx, where xxx is a suffix not beginning with an upper case letter. Here is an example of an example: func ExamplePrintln() { Println("The output of this example.") // Output: The output of // this example. } The entire test file is presented as the example when it contains a single example function, at least one other function, type, variable, or constant declaration, and no test or benchmark functions. See the documentation of the testing package for more information. AUTHOR
This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others). 2012-05-13 GO-TESTFUNC(7)

Check Out this Related Man Page

GO(1)							      General Commands Manual							     GO(1)

NAME
go - tool for managing Go source code SYNOPSIS
go command [arguments] DESCRIPTION
The Go distribution includes a command, named go, that automates the downloading, building, installation, and testing of Go packages and commands. COMMANDS
Each command is documented in its own manpage. For example, the build command is documented in go-build(1). The commands are: build compile packages and dependencies clean remove object files doc run godoc on package sources env print Go environment information fix run go tool fix on packages fmt run gofmt on package sources get download and install packages and dependencies install compile and install packages and dependencies list list packages run compile and run Go program test test packages tool run specified go tool version print Go version vet run go tool vet on packages EXAMPLES
TODO SEE ALSO
go-build(1), go-clean(1). AUTHOR
This manual page was written by Michael Stapelberg <stapelberg@debian.org>, for the Debian project (and may be used by others). 2012-05-13 GO(1)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sig test

Just testing my sig.. if it doesnt work need some more help.. (2 Replies)
Discussion started by: Voodoo Child
2 Replies

2. UNIX for Dummies Questions & Answers

find command

How would I put each path the find command returns into a separate variable? find . -type d -name *_criteria ./mycode/test/sts_criteria into variable $MyData(1) ./WWE/wwe_criteria into variable $MyData(2) ./aaa_criteris into variable $MyData(3) ????? Thank you. (4 Replies)
Discussion started by: MrJaunty
4 Replies

3. UNIX for Advanced & Expert Users

Using Ncurses for testing vi

Hi, Somebody has told me that NCurses can be used to test vi. But i was unable to figure out how. If anybody has done anything with NCurses please reply. Also is there any othre way by which we can test vi automatically? (2 Replies)
Discussion started by: rahulrathod
2 Replies

4. Shell Programming and Scripting

Redirect question

Hi, I need some help to achive the follwoing task: I have a file named test that contain the following line: 'Hellow world','good morning' I want to attach the content of this file to a variable named var , and then rediarect it to a second file bamed test_new. The result should look like... (2 Replies)
Discussion started by: yoavbe
2 Replies

5. Shell Programming and Scripting

Use sed to merge multiple lines

Hi all: I have a file in which the contents are as following: ... This is a test ONE TWO Hello, world! XXX YYY CCC test again three, four five six seven world AAA BBB QQQ test eight, nine world (3 Replies)
Discussion started by: xb88
3 Replies

6. Programming

Redirect Output Multi-Process

Hi, I'm trying to compile the following code: /************** Begin <test.c> ***************/ /* * Compiled with: gcc -Wall -o test test.c */ #include <stdio.h> #include <unistd.h> int main(void) { printf("I'm process %d, son of %d \n", getpid(), getppid()); printf("Hello \n");... (3 Replies)
Discussion started by: djodjo
3 Replies

7. Shell Programming and Scripting

Test variable

hi, i store a constant in a variable and want to test whether it is M or Z. how can i achieve this?? please help variable='M' if then ehco 'success' fi; is this right ?? (2 Replies)
Discussion started by: javeed7
2 Replies

8. UNIX for Dummies Questions & Answers

testing if files exist

I am trying to test arguments to see if they are files in any directory. I have : but it's not working (7 Replies)
Discussion started by: skooly5
7 Replies

9. Programming

Redirect Standard Output Multi-Process

Hi, I'm trying to compile the following code: /************** Begin <test.c> ***************/ /* * Compiled with: gcc -Wall -o test test.c */ #include <stdio.h> #include <unistd.h> int main(void) { printf("I'm process %d, son of %d \n", getpid(), getppid()); ... (5 Replies)
Discussion started by: djodjo
5 Replies

10. Shell Programming and Scripting

SED replacement

Hi, i have a file with lines, file.txt ------- test is fun testing is better I need to replace 'test' to 'develop' and i used, a=test b=develop sed "s,$a,$b,g" -------- but i see the word 'testing' is also replaced. Need some solution. Is there any way i could replace only 'test' ? (4 Replies)
Discussion started by: giri_luck
4 Replies

11. UNIX for Dummies Questions & Answers

== vs -eq and functions

Hey I have a question.... what is the difference between using == vs -eq when testing in WHILE loops. I use the following test that only worked with == signs.... if why do i need == and not -eq? 2. I need to re-use some code in a couple places in this script. is functions my best... (5 Replies)
Discussion started by: danieldcc
5 Replies

12. Shell Programming and Scripting

Help with replace column one content based on reference file

Input file 1 testing 10 20 1 A testing 20 40 1 3 testing 23 232 2 1 testing 10 243 2 . . Reference file 1 final 3 used . . Output file (2 Replies)
Discussion started by: perl_beginner
2 Replies

13. UNIX for Dummies Questions & Answers

Using iozone for testing solid state drives

hi all, anyone knows how to test ssd using iozon, I am currently running iozone and I don't know if it is testing the ssd or just the RAM... anyone knows a good tutorial (like a step-by-step)? cannot find any in google.. Thanks! (3 Replies)
Discussion started by: h0ujun
3 Replies

14. Shell Programming and Scripting

Prefixing test case methods with letter 'test'

Hi, I have a Python unit test cases source code file which contains more than a hundred test case methods. In that, some of the test case methods already have prefix 'test' where as some of them do not have. Now, I need to add the string 'test' (case-sensitive) as a prefix to those of the... (5 Replies)
Discussion started by: royalibrahim
5 Replies

15. Shell Programming and Scripting

Shc : trying to test functionality "test" compiling but can not execute

I am testing shc to see if it would help with my need. Im at a point where Im trying to compile and test the "test.ksh" file that comes in the tar ball : shc-3.8.9> shc -v -r -f test.ksh shc shll=ksh shc =-c shc =exec '%s' "$@" shc = shc opts= shc: cc test.ksh.x.c -o test.ksh.x... (7 Replies)
Discussion started by: popeye
7 Replies