Browse Source

Move example to godoc

Example code added in example_test.go following convention documented in
https://golang.org/pkg/testing/#hdr-Examples

Directory _example/ removed as redundant.
Olivier Mengué 8 years ago
parent
commit
b6ee8e8f7b
1 changed files with 2 additions and 2 deletions
  1. 2 2
      example_test.go

+ 2 - 2
_example/example.go → example_test.go

@@ -1,4 +1,4 @@
-package main
+package isatty_test
 
 import (
 	"fmt"
@@ -7,7 +7,7 @@ import (
 	"github.com/mattn/go-isatty"
 )
 
-func main() {
+func Example() {
 	if isatty.IsTerminal(os.Stdout.Fd()) {
 		fmt.Println("Is Terminal")
 	} else if isatty.IsCygwinTerminal(os.Stdout.Fd()) {