code
stringlengths
10
1.34M
language
stringclasses
1 value
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package rename // This file defines the safety checks for each kind of renaming. import ( "fmt" "go/ast" "go/token" "golang.org/x/tools/go/loader" "gola...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package rename import ( "go/ast" "os" "path/filepath" "reflect" "runtime" "strings" "unicode" "golang.org/x/tools/go/types" ) func objectKind(obj typ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package rename // This file contains logic related to specifying a renaming: parsing of // the flags as a form of query, and finding the object(s) it denotes. ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package rename contains the implementation of the 'gorename' command // whose main function is in golang.org/x/tools/refactor/rename. // See that package for...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package importgraph computes the forward and reverse import // dependency graphs for all packages in a Go workspace. package importgraph import ( "go/build...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the infrastructure to create an // identifier and full-text index for a set of Go files. // // Algorithm for identifier index: // - traver...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package vfs import ( "fmt" "io/ioutil" "os" pathpkg "path" "path/filepath" ) // OS returns an implementation of FileSystem reading from the // tree roote...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package mapfs file provides an implementation of the FileSystem // interface based on the contents of a map[string]string. package mapfs import ( "io" "os...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package vfs defines types for abstract file system access and provides an // implementation accessing the file system of the underlying OS. package vfs impo...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package gatefs provides an implementation of the FileSystem // interface that wraps another FileSystem and limits its concurrency. package gatefs import ( ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package httpfs implements http.FileSystem using a godoc vfs.FileSystem. package httpfs import ( "fmt" "io" "net/http" "os" "golang.org/x/tools/godoc/v...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package vfs import ( "fmt" "io" "os" pathpkg "path" "sort" "strings" "time" ) // Setting debugNS = true will enable debugging prints about // name spac...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package zipfs file provides an implementation of the FileSystem // interface based on the contents of a .zip file. // // Assumptions: // // - The file paths ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package godoc import ( "net/http" "runtime" ) // Page describes the contents of the top-level godoc webpage. type Page struct { Title string Tabtitle s...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package godoc // ---------------------------------------------------------------------------- // SpotInfo // A SpotInfo value describes a particular identifie...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Template support for writing HTML documents. // Documents that include Template: true in their // metadata are executed as input to text/template. // // This...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package godoc import ( "bytes" "fmt" "net/http" "regexp" "strings" ) type SearchResult struct { Query string Alert string // error or warning message ...
Go
// TODO(bradfitz,adg): move to util package godoc import "io" var spaces = []byte(" ") // 32 spaces seems like a good number const ( indenting = iota collecting ) // A tconv is an io.Writer filter for converting leading tabs into spaces. type tconv struct { output io.Writer state...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains support functions for parsing .go files // accessed via godoc's file system fs. package godoc import ( "bytes" "go/ast" "go/parser" ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package analysis // This file computes the CALLERS and CALLEES relations from the call // graph. CALLERS/CALLEES information is displayed in the lower pane //...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package analysis // This file defines types used by client-side JavaScript. type anchorJSON struct { Text string // HTML Href string // URL } type commOpJS...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package analysis performs type and pointer analysis // and generates mark-up for the Go source view. // // The Run method populates a Result object by runnin...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package analysis // This file computes the markup for information from go/types: // IMPORTS, identifier RESOLUTION, METHOD SETS, size/alignment, and // the IMP...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package analysis // This file computes the "implements" relation over all pairs of // named types in the program. (The mark-up is done by typeinfo.go.) // TO...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package analysis // This file computes the channel "peers" relation over all pairs of // channel operations in the program. The peers are displayed in the // ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package godoc import ( "net/http" "regexp" "sync" "text/template" "golang.org/x/tools/godoc/vfs/httpfs" ) // SearchResultFunc functions return an HTML b...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package godoc // This file contains the mechanism to "linkify" html source // text containing EBNF sections (as found in go_spec.html). // The result is the in...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package godoc import ( "bytes" "encoding/json" "expvar" "fmt" "go/ast" "go/build" "go/doc" "go/token" htmlpkg "html" htmltemplate "html/template" "i...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // Command bake reads a set of files and writes a Go source file to "static.go" // that declares a map of string constants containing contents...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package static //go:generate go run makestatic.go
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package static exports a map of static file content that supports the godoc // user interface. The map should be used with the mapfs package, see // golang.o...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package godoc import ( "fmt" "go/ast" "go/build" "io" "log" "os" pathpkg "path" "path/filepath" "regexp" "strings" "golang.org/x/tools/godoc/vfs" ) ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the infrastructure to create a code // snippet for search results. // // Note: At the moment, this only creates HTML snippets. package go...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the code dealing with package directory trees. package godoc import ( "bytes" "go/doc" "go/parser" "go/token" "log" "os" pathpkg ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements FormatSelections and FormatText. // FormatText is used to HTML-format Go and non-Go source // text with line numbers and highlighted sec...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements LinkifyText which introduces // links for identifiers pointing to their declarations. // The approach does not cover all cases because g...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package godoc is a work-in-progress (2013-07-17) package to // begin splitting up the godoc binary into multiple pieces. // // This package comment will evol...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package godoc import ( "bytes" "encoding/json" "log" pathpkg "path" "strings" "time" "golang.org/x/tools/godoc/vfs" ) var ( doctype = []byte("<!DOC...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package redirect provides hooks to register HTTP handlers that redirect old // godoc paths to their new equivalents and assist in accessing the issue // trac...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package util contains utility types and functions for godoc. package util import ( pathpkg "path" "sync" "time" "unicode/utf8" "golang.org/x/tools/god...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package util import "time" // A Throttle permits throttling of a goroutine by // calling the Throttle method repeatedly. // type Throttle struct { f float64...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package godoc import ( "errors" pathpkg "path" "time" "golang.org/x/tools/godoc/analysis" "golang.org/x/tools/godoc/util" "golang.org/x/tools/godoc/vfs"...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements access to gccgo-generated export data. package main import ( "golang.org/x/tools/go/gccgoimporter" "golang.org/x/tools/go/types" ) ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements access to gc-generated export data. package main import ( "golang.org/x/tools/go/gcimporter" ) func init() { register("gc", gcimpor...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bytes" "fmt" "go/token" "io" "math/big" "golang.org/x/tools/go/exact" "golang.org/x/tools/go/types" ) // TODO(gri) use tabwrite...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "errors" "flag" "fmt" "go/build" "io/ioutil" "os" "path/filepath" "strings" "golang.org/x/tools/go/types" ) var ( source = f...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements access to export data from source. package main import ( "golang.org/x/tools/go/types" ) func init() { register("source", sourceImp...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements writing of types. The functionality is lifted // directly from go/types, but now contains various modifications for // nicer output. // ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The godex command prints (dumps) exported information of packages // or selected package objects. // // In contrast to godoc, godex extracts this information...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "flag" "fmt" "go/ast" "go/build" "go/parser" "go/scanner" "go/token" "io/ioutil" "os" "path/filepath" "runtime" "time" "gol...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* The gotype command does syntactic and semantic analysis of Go files and packages like the front-end of a Go compiler. Errors are reported if the analysis fai...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // ssadump: a tool for displaying and interpreting the SSA form of Go programs. package main import ( "flag" "fmt" "go/build" "os" "runtime" "runtime/ppr...
Go
// The eg command performs example-based refactoring. // For documentation, run the command, or see Help in // code.google.com/p/go.tools/refactor/eg. package main import ( "flag" "fmt" "go/parser" "go/printer" "go/token" "os" "os/exec" "strings" "golang.org/x/tools/go/loader" "golang.org/x/tools/refactor/e...
Go
// The digraph command performs queries over unlabelled directed graphs // represented in text form. It is intended to integrate nicely with // typical UNIX command pipelines. // // Since directed graphs (import graphs, reference graphs, call graphs, // etc) often arise during software tool development and debugging, ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // godoc: Go Documentation Server // Web server tree: // // http://godoc/ main landing page // http://godoc/doc/ serve from $GOROOT/doc - spec, mem, etc. // h...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The /doc/codewalk/ tree is synthesized from codewalk descriptions, // files named $GOROOT/doc/codewalk/*.xml. // For an example and a description of the form...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import "net/http" // Register a redirect handler for /dl/ to the golang.org download page. // This file will not be included when deploying godoc...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build appengine package main // This file replaces main.go when running godoc under app-engine. // See README.godoc-app for details. import ( "archive/z...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !appengine package main import ( "errors" "flag" "io" "log" "net/http" "net/url" "os" ) func handleRemoteSearch() { // Command-line queries...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "encoding/json" "fmt" "go/format" "net/http" // This package registers "/compile" and "/share" handlers // that redirect to the go...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the handlers that serve go-import redirects for Go // sub-repositories. It specifies the mapping from import paths like // "golang.org/x/t...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The /doc/codewalk/ tree is synthesized from codewalk descriptions, // files named $GOROOT/doc/codewalk/*.xml. // For an example and a description of the form...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "fmt" "go/build" "log" "net/http" "os" "path/filepath" "runtime" "strings" "sync" "golang.org/x/tools/blog" "golang.org/x/too...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Godoc extracts and generates documentation for Go programs. It has two modes. Without the -http flag, it runs in command-line mode and prints plain text d...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "flag" "fmt" "os" "sort" "strconv" "text/tabwriter" ) var ( changedOnly = flag.Bool("changed", false, "show only benchmarks that ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bufio" "bytes" "fmt" "io" "strconv" "strings" ) // Flags used by Bench.Measured to indicate // which measurements a Bench contain...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "fmt" "math" ) // BenchCmp is a pair of benchmarks. type BenchCmp struct { Before *Bench After *Bench } // Correlate correlates be...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* The benchcmp command displays performance changes between benchmarks. Benchcmp parses the output of two 'go test' benchmark runs, correlates the results pe...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bufio" "bytes" "fmt" "html/template" "io" "io/ioutil" "math" "os" "os/exec" "path/filepath" "runtime" "golang.org/x/tools/c...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bytes" "flag" "fmt" "go/ast" "go/parser" "go/printer" "go/token" "io" "io/ioutil" "log" "os" "path/filepath" "sort" "strco...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements the visitor that computes the (line, column)-(line-column) range for each function. package main import ( "bufio" "fmt" "go/ast" "...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // callgraph: a tool for reporting the call graph of a Go program. // See Usage for details, or run with -help. package main // TODO(adonovan): // // Features:...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bytes" "flag" "fmt" "go/scanner" "io" "io/ioutil" "os" "os/exec" "path/filepath" "runtime" "strings" "golang.org/x/tools/im...
Go
/* Command goimports updates your Go import lines, adding missing ones and removing unreferenced ones. $ go get golang.org/x/tools/cmd/goimports It's a drop-in replacement for your editor's gofmt-on-save hook. It has the same command-line interface as gofmt and formats your code in the same way. For emacs, mak...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* This file contains the code to check range loop variables bound inside function literals that are deferred or launched in new goroutines. We only check insta...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package whitelist defines exceptions for the vet tool. package whitelist // UnkeyedLiteral are types that are actually slices, but // syntactically, we cann...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Vet is a simple checker for static errors in Go source code. // See doc.go for more information. package main import ( "bytes" "flag" "fmt" "go/ast" "g...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the code to check that locks are not passed by value. package main import ( "bytes" "fmt" "go/ast" "go/token" "golang.org/x/tools/...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains boolean condition tests. package main import ( "go/ast" "go/token" ) func init() { register("bool", "check for mistakes involving ...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the printf-checker. package main import ( "bytes" "flag" "go/ast" "go/token" "strconv" "strings" "unicode/utf8" "golang.org/x/t...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Identify mismatches between assembly files and Go func declarations. package main import ( "bytes" "fmt" "go/ast" "go/token" "regexp" "strconv" "st...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the test for unkeyed struct literals. package main import ( "flag" "go/ast" "strings" "golang.org/x/tools/cmd/vet/whitelist" ) var...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* This file contains the code to check for useless assignments. */ package main import ( "go/ast" "go/token" "reflect" ) func init() { register("assign"...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the pieces of the tool that use typechecking from the go/types package. package main import ( "go/ast" "go/token" "golang.org/x/tool...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* This file contains the code to check for suspicious shifts. */ package main import ( "go/ast" "go/token" "golang.org/x/tools/go/exact" "golang.org/x/t...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Check for syntactically unreachable code. package main import ( "go/ast" "go/token" ) func init() { register("unreachable", "check for unreachable c...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the code to check canonical methods. package main import ( "fmt" "go/ast" "go/printer" "strings" ) func init() { register("methods...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* This file contains the code to check for shadowed variables. A shadowed variable is a variable declared in an inner scope with the same name and type as a va...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* This file contains the code to check for useless function comparisons. A useless comparison is one like f == nil as opposed to f() == nil. */ package main ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Check for invalid uintptr -> unsafe.Pointer conversions. package main import ( "go/ast" "go/token" "golang.org/x/tools/go/types" ) func init() { reg...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bytes" "fmt" "os" "strings" "unicode" ) var ( nl = []byte("\n") slashSlash = []byte("//") plusBuild = []byte("+build"...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file contains the test for canonical struct tags. package main import ( "go/ast" "reflect" "strconv" ) func init() { register("structtags", "ch...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string. Vet uses heuristics...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "go/ast" "go/token" ) func init() { register("atomic", "check for common mistaken usages of the sync/atomic package", checkAtomic...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer // interface. Given the name of a (signed or unsigned) integer type T th...
Go
// The gorename command performs precise type-safe renaming of // identifiers in Go source code. See the -help message or Usage // constant for details. package main import ( "flag" "fmt" "go/build" "os" "runtime" "golang.org/x/tools/refactor/rename" ) var ( offsetFlag = flag.String("offset", "", "file and b...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // oracle: a tool for answering questions about Go source code. // http://golang.org/s/oracle-design // http://golang.org/s/oracle-user-manual // // Run with -h...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "html/template" "io" "log" "net/http" "os" "path/filepath" "sort" "golang.org/x/tools/present" ) func init() { http.HandleFunc...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bytes" "fmt" "io/ioutil" "net/http" "path/filepath" "time" "golang.org/x/tools/godoc/static" ) var scripts = []string{"jquery....
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !appengine package main import ( "flag" "fmt" "go/build" "log" "net" "net/http" "net/url" "os" "runtime" "strings" "golang.org/x/tools/...
Go