This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"math" | |
"math/rand" | |
"runtime" | |
"sync" | |
"time" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for pkg in $(go list std | grep -v vendor) | |
do | |
go build $pkg && if [[ "$(go doc $pkg | grep '^func\|^var\|^type\|^const' | wc -l)" -eq "0" ]] | |
then | |
echo $pkg | |
fi | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package profiling | |
import "testing" | |
func div(a, b int) int { | |
return int(float64(a) / float64(b)) | |
} | |
var s int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"window.zoomLevel": 0, | |
"go.lintOnSave": "package", | |
"editor.fontFamily": "'Fira Code', Menlo, Monaco, 'Courier New', monospace", | |
"editor.fontLigatures": false, | |
"workbench.iconTheme": "vs-seti", | |
"go.addTags": { | |
"tags": "json", | |
"options": "json=omitempty", | |
"promptForTags": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
func main() { | |
fmt.Println("Hello, world") | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"os" | |
) | |
func main() { | |
if len(os.Args) < 2 { | |
fmt.Fprintf(os.Stderr, "usage:\n\t%s [files]\n", os.Args[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs := token.NewFileSet() | |
for _, arg := range os.Args[1:] { | |
b, err := ioutil.ReadFile(arg) | |
if err != nil { | |
log.Fatal(err) | |
} | |
f := fs.AddFile(arg, fs.Base(), len(b)) | |
var s scanner.Scanner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"go/parser" | |
"go/token" | |
"log" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"go/parser" | |
"go/token" | |
"log" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"go/parser" | |
"go/token" | |
"log" | |
"github.com/davecgh/go-spew/spew" | |
) |