code
stringlengths
10
1.34M
language
stringclasses
1 value
package callback //#include "callback.h" import "C" import ( "runtime" "unsafe" ) //export newCallbackRunner func newCallbackRunner() { go C.runCallbacks() } func init() { // work around issue 1560. if runtime.GOMAXPROCS(0) < 2 { runtime.GOMAXPROCS(2) } C.callbackInit() go C.runCallbacks() } // Func hold...
Go
package rpcreflect import ( "fmt" "encoding/json" "reflect" "strings" ) // simple types: // string -> "string" // int8, int64 etc -> "number" // interface{} -> "any" // // composite types: // slice, array -> [elemType] // struct -> {"Field1": field1Type, "Field2": field2Type, etc} // map -> {"_map": elemType} // ...
Go
// The event package demonstrates use of the callback package // to call Go functions from a non-Go-created thread. // The C "window" API is intended to represent a conventional // C API which invokes callbacks from a thread it has created itself. // The event package layers a Go callback on top of that. package event ...
Go
// Looper is an example package demonstrating use of the callback // package. When a new Looper type is made, a new pthread is // created which continually loops calling the callback function // until it returns false. package looper //#include <pthread.h> //#include <unistd.h> //#define nil ((void*)0) //typedef struc...
Go
package stquery import ( "fmt" "reflect" "strings" ) // Scanner represents a database row that can scan itself. type Scanner interface { Scan(dest ...interface{}) error } // Statement returns an SQL query statement that selects columns based // on the names of the fields in dest, which must be a pointer // to a ...
Go
// The sym package provides a way to iterate over and change the symbols in Go // source files. package sym import ( "bytes" "code.google.com/p/rog-go/exp/go/ast" "code.google.com/p/rog-go/exp/go/parser" "code.google.com/p/rog-go/exp/go/printer" "code.google.com/p/rog-go/exp/go/token" "code.google.com/p/rog-go/e...
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 implements printing of AST nodes; specifically // expressions, statements, declarations, and files. It uses // the print functionality implemented ...
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 printer implements printing of AST nodes. package printer import ( "bytes" "code.google.com/p/rog-go/exp/go/ast" "code.google.com/p/rog-go/exp/go...
Go
package types import ( "code.google.com/p/rog-go/exp/go/ast" "code.google.com/p/rog-go/exp/go/token" ) func declPos(name string, decl ast.Node) token.Pos { switch d := decl.(type) { case nil: return token.NoPos case *ast.AssignStmt: for _, n := range d.Lhs { if n, ok := n.(*ast.Ident); ok && n.Name == nam...
Go
package types import ( "runtime" "strings" ) // Code for determining system-specific files stolen from // goinstall. We can't automatically generate goosList and // goarchList if this package is to remain goinstallable. const goosList = "darwin freebsd linux plan9 windows " const goarchList = "386 amd64 arm " // ...
Go
// Types infers source locations and types from Go expressions. // and allows enumeration of the type's method or field members. package types import ( "bytes" "code.google.com/p/rog-go/exp/go/ast" "code.google.com/p/rog-go/exp/go/parser" "code.google.com/p/rog-go/exp/go/printer" "code.google.com/p/rog-go/exp/go/...
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 exported entry points for invoking the parser. package parser import ( "bytes" "code.google.com/p/rog-go/exp/go/ast" "code.google...
Go
package parser import "code.google.com/p/rog-go/exp/go/ast" var Universe = ast.NewScope(nil) func declObj(kind ast.ObjKind, name string) { // don't use Insert because it forbids adding to Universe Universe.Objects[name] = ast.NewObj(kind, name) } func init() { declObj(ast.Typ, "bool") declObj(ast.Typ, "complex...
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. // A parser for Go source files. Input may be provided in a variety of // forms (see the various Parse* functions); the output is an abstract // syntax tree (AS...
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. // TODO(gri) consider making this a separate package outside the go directory. package token import ( "fmt" "sort" "sync" ) // Position describes an arbit...
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 package defines constants representing the lexical // tokens of the Go programming language and basic operations // on tokens (printing, predicates). //...
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 scanner import ( "code.google.com/p/rog-go/exp/go/token" "fmt" "io" "sort" ) // An implementation of an ErrorHandler may be provided to the Scanne...
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 scanner implements a scanner for Go source text. Takes a []byte as // source which can then be tokenized through repeated calls to the Scan // functi...
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 ast declares the types used to represent syntax trees for Go // packages. // package ast import ( "code.google.com/p/rog-go/exp/go/token" "unicode...
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 printing suppport for ASTs. package ast import ( "code.google.com/p/rog-go/exp/go/token" "fmt" "io" "os" "reflect" ) // A FieldFil...
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 NewPackage. package ast import ( "code.google.com/p/rog-go/exp/go/scanner" "code.google.com/p/rog-go/exp/go/token" "fmt" "strconv"...
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 ast import "code.google.com/p/rog-go/exp/go/token" // ---------------------------------------------------------------------------- // Export filtering...
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 implements scopes and the objects they contain. package ast import ( "bytes" "code.google.com/p/rog-go/exp/go/token" "fmt" ) // A Scope maint...
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 ast import "fmt" // A Visitor's Visit method is invoked for each node encountered by Walk. // If the result visitor w is not nil, Walk visits each of ...
Go
package readlines import ( "bufio" "io" "unicode/utf8" ) // Iter reads lines from r and calls fn with each read line, not // including the line terminator. If a line exceeds the given maximum // size, it will be truncated and the rest of the line discarded. If fn // returns a non-nil error, reading ends and the ...
Go
// The netchanrpc package makes it possible to run an RPC service // over netchan. package ncnet import ( "errors" "fmt" "io" "log" "net" "netchan" ) const initMessage = "netconnect" type netchanAddr string type hanguper interface { Hangup(name string) error } func (a netchanAddr) String() string { return ...
Go
// +build ignore package values // Marshal returns the value encoding of v. // Marshal traverses the value recursively. // // Boolean values encode as bool. // Signed integer types encode as int64. // Unsigned integer types encode as uint64. // Floating point types encode as float64 // Complex types encode as comple...
Go
// rpcreader demonstrates using RPC to initiate file streaming // over the same connection. // // Start a server instance with: // // rpcreader -s addr // // Start a client with: // // rpcreader addr // // The client is interactive. There's only one command: read, // which takes a list of filename arguments and...
Go
package main import ( "code.google.com/p/goplan9/plan9/acme" "fmt" "io" "os" "os/user" "strconv" "strings" ) // We would use io.Copy except for a bug in acme // where it crashes when reading trying to read more // than the negotiated 9P message size. func copyBody(w io.Writer, win *acme.Win) error { buf := ma...
Go
// The apipe command pipes the contents of the current acme window // through its argument shell command and updates them to the result // by applying minimal changes. // // For example: // // apipe gofmt // // will alter only the pieces of source code that // have changed, leaving the rest untouched. package main im...
Go
package main import ( "bytes" "flag" "fmt" "launchpad.net/goamz/aws" "launchpad.net/goamz/ec2" "os" "regexp" "strings" ) type cmd struct { name string args string f func(cmd, *ec2.EC2, []string) flags *flag.FlagSet } var cmds []cmd func main() { flag.Parse() if flag.Arg(0) == "" { errorf("no c...
Go
package main import ( "code.google.com/p/rog-go/loopback" "flag" "fmt" "io" "os" ) var localNet = flag.String("i", "tcp", "network to listen on (accepts loopback options)") var remoteNet = flag.String("r", "tcp", "network to dial (accepts loopback options)") var useStdin = flag.Bool("s", false, "use stdin and st...
Go
package main import ( "fmt" "math/rand" // "time" stats "github.com/patrick-higgins/summstat" ) func main() { // rand.Seed(int64(time.Now().Nanosecond())) r := make([]*stats.Stats, 4) for i := range r { r[i] = stats.NewStats() // r[i].CreateBins(100, 0, 200) } const n = 100000 for i := 0; i < n; i++ { cs ...
Go
package main func newCharacter(paths map[string][]square) *character { ch := &character{ paths: paths, roll: roll, } ch.pos = findPos(ch, "start", 1) return ch } var peterPaths = map[string][]square{ "start": []square{ 5: { land: jumpTo("start", 1), }, 7: { land: jumpTo("under gate", 1), }, 1...
Go
// Share is a piece of demo code to illustrate the flexibility of the rpc and netchan // packages. It requires one instance to be running in server mode on some network // address addr, e.g. localhost:3456: // // share -s localhost:3456 // // Then in other windows or on other machines, run some client instances: // sh...
Go
// A "simple" program to display some text and let the // user drag it around. It will get simpler... package main import ( "code.google.com/p/freetype-go/freetype/truetype" "code.google.com/p/rog-go/canvas" "code.google.com/p/rog-go/x11" "exp/draw" "image" "io/ioutil" "log" "os" ) var cvs *canvas.Canvas fun...
Go
// The stackgraph command reads a Go stack trace (as produced by a Go // panic) from its standard input and writes an SVG file suitable for // viewing in a web browser on its standard output. It assumes that // graphviz is installed. // // All the dot(1) heuristics were unashamedly stolen from go tool pprof. // // Exam...
Go
package main import ( "bytes" "fmt" "io" "log" "math" "os" "os/exec" "regexp" "strings" "text/template" ) func (n *Node) ArgCounts() string { counts := make([]string, len(n.ArgCount)) for i, m := range n.ArgCount { if len(m) == 1 { for val, _ := range m { counts[i] = fmt.Sprintf("=%#x", val) }...
Go
package main import ( "errors" "fmt" "math/big" "os" "reflect" "strings" ) // TODO: // testing // parse type[value] // formatting with /x, /%.5d etc const debug = false type genericOp struct { numIn, numOut int f func(s *stack, name string) } var errStackUnderflow = errors.New("stack underflow...
Go
package main import ( "math" "math/big" "regexp" "strconv" "strings" ) var ops = map[string][]interface{}{ // constants "pi": {math.Pi}, "e": {math.E}, "phi": {math.Phi}, "nan": {math.NaN()}, "infinity": {math.Inf(1)}, // functions from math package. "abs": {math.Abs, (*big...
Go
package main import ( "fmt" "sort" ) var help = genericOp{0, 0, func(*stack, string) { var lines []string for name, vs := range ops { lines = append(lines, fmt.Sprintf("%s[%d]", name, argCount(vs[0]))) } sort.Strings(lines) for _, l := range lines { fmt.Printf("%s\n", l) } }} func printAll() { for name,...
Go
/* Calc is a calculator designed to be run on the command line. Expressions rarely require quoting and work easily with other command line tools that produce or require whitespace-separated text. Here is a brief overview by demonstration: # The command line is revert-polish - operands are # pushed onto a stack; ope...
Go
package main import ( "code.google.com/p/rog-go/canvas" "exp/draw" "exp/draw/x11" "flag" "image" "image/color" "log" "time" ) type stack struct { f Fractal centre draw.Point iterations int next *stack } type context struct { cvs *canvas.Canvas f Fractal pushed *s...
Go
package main import ( "code.google.com/p/freetype-go/freetype/raster" "code.google.com/p/rog-go/canvas" "code.google.com/p/rog-go/values" "exp/draw" "exp/draw/x11" "fmt" "image" "image/color" "log" ) var cvs *canvas.Canvas func main() { ctxt, err := x11.NewWindow() if ctxt == nil { log.Fatalf("no window...
Go
/* The pxargs command is a simpler version of xargs(1) that can execute commands in parallel. It reads lines from standard input and executes the command with the lines as arguments. Flags determine the maximum number of arguments to give to the command and the maximum number of commands to run concurrently. Unlike xa...
Go
// Share is a piece of demo code to illustrate the flexibility of the rpc and netchan // packages. It requires one instance to be running in server mode on some network // address addr, e.g. localhost:3456: // // share -s localhost:3456 // // Then in other windows or on other machines, run some client instances: // sh...
Go
// Share is a piece of demo code to illustrate the flexibility of the rpc and netchan // packages. It requires one instance to be running in server mode on some network // address addr, e.g. localhost:3456: // // share -s localhost:3456 // // Then in other windows or on other machines, run some client instances: // sh...
Go
// The timestamp command annotates lines read from standard input // with the time that they were read. This is useful for seeing // timing information on running commands from the shell. // // With no file arguments, timestamp prints lines read // from standard input prefixed with a timestamp, // the time since the ti...
Go
package main import ( "code.google.com/p/freetype-go/freetype/truetype" "code.google.com/p/rog-go/canvas" "code.google.com/p/rog-go/values" "code.google.com/p/x-go-binding/ui" "code.google.com/p/x-go-binding/ui/x11" "fmt" "image" "image/color" "io/ioutil" "log" "math" "math/rand" "os" "time" ) // to add...
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 g9pc import "code.google.com/p/rog-go/go9p/g9p" // Removes the file associated with the Fid. Returns nil if the // operation is successful. func (cln...
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 g9pc import ( "code.google.com/p/rog-go/go9p/g9p" "net" ) // Creates an authentication fid for the specified user. Returns the fid, if // successfu...
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 g9pc import ( "code.google.com/p/rog-go/go9p/g9p" "strings" ) // Opens the file associated with the fid. Returns nil if // the operation is success...
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 g9pc import "code.google.com/p/rog-go/go9p/g9p" // Reads count bytes starting from offset from the file associated with the fid. // Returns a slice w...
Go
package main import ( "code.google.com/p/rog-go/go9p/g9p" "code.google.com/p/rog-go/go9p/g9pc" "flag" "fmt" "log" "os" ) var debuglevel = flag.Int("d", 0, "debuglevel") var addr = flag.String("addr", "127.0.0.1:5640", "network address") func main() { var n int var user g9p.User var file *g9pc.File flag.Pa...
Go
package main import ( "code.google.com/p/rog-go/go9p/g9p" "code.google.com/p/rog-go/go9p/g9pc" "flag" "fmt" "io" "log" "os" ) var debuglevel = flag.Int("d", 0, "debuglevel") var addr = flag.String("addr", "127.0.0.1:5640", "network address") func main() { var m int var user g9p.User var file *g9pc.File f...
Go
package main // An interactive client for 9P servers. import ( "bufio" "code.google.com/p/rog-go/go9p/g9p" "code.google.com/p/rog-go/go9p/g9pc" "code.google.com/p/rog-go/go9p/g9plog" "flag" "fmt" "io" "log" "net/http" "os" "path" "strings" ) var addr = flag.String("addr", "127.0.0.1:5640", "network addre...
Go
package main import ( "code.google.com/p/rog-go/go9p/g9p" "code.google.com/p/rog-go/go9p/g9pc" "flag" "fmt" "log" "os" ) var debuglevel = flag.Int("d", 0, "debuglevel") var addr = flag.String("addr", "127.0.0.1:5640", "network address") func main() { var user g9p.User var err error var c *g9pc.Client var f...
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 g9pc import "code.google.com/p/rog-go/go9p/g9p" // Clunks a fid. Returns nil if successful. func (clnt *Client) Clunk(fid *Fid) (err error) { if fid...
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 g9pc import "code.google.com/p/rog-go/go9p/g9p" // Write up to len(data) bytes starting from offset. Returns the // number of bytes written, or an Er...
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 g9pc import "code.google.com/p/rog-go/go9p/g9p" // Returns the metadata for the file associated with the Fid, or an Error. func (clnt *Client) Stat(f...
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 g9pc import ( "code.google.com/p/rog-go/go9p/g9p" "strings" "syscall" ) // Starting from the file associated with fid, walks all wnames in // sequ...
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 g9pc var m2id = [...]uint8{ 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0, 5, 0, 1, 0, 2, 0, 1, 0, ...
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. // The srv package provides definitions and functions used to implement // a 9P2000 file client. package g9pc import ( "code.google.com/p/rog-go/go9p/g9p" "...
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 g9p // Logger is a common interface that allows clients and servers // to see all 9p messages in transit, for debugging, for // instance. type Logger ...
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. // The p9 package g9provides the definitions and functions used to implement // the 9P2000 protocol. package g9p import "syscall" // 9P2000 message types con...
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 g9p import "fmt" func permToString(perm uint32) string { ret := "" if perm&DMDIR != 0 { ret += "d" } if perm&DMAPPEND != 0 { ret += "a" } ...
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 g9p import ( "fmt" "syscall" ) // Creates a Fcall value from the on-the-wire representation. If // dotu is true, reads 9P2000.u messages. Returns t...
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 g9p // Create a Tversion message in the specified Fcall. func PackTversion(fc *Fcall, msize uint32, version string) error { size := 4 + 2 + len(versi...
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 g9p import "sync" var once sync.Once type osUser struct { uid int } type osUsers struct { users map[int]*osUser groups map[int]*osGroup sync.M...
Go
package g9plog import ( "code.google.com/p/rog-go/go9p/g9p" "container/list" "fmt" "net/http" "sync" ) type httpStats struct { mu sync.Mutex conns list.List maxId int } const ( Packets = 1 << iota ) type Logger struct { mu sync.Mutex history list.List maxHist int isClient bool flags int ...
Go
package canvas import ( "code.google.com/p/freetype-go/freetype/raster" "fmt" "image" "image/color" "image/draw" ) // A RasterItem is a low level canvas object that // can be used to build higher level primitives. // It implements Item, and will calculate // (and remember) its bounding box on request. // // Othe...
Go
package canvas import ( "code.google.com/p/freetype-go/freetype/raster" "image" ) // A ellipse object represents an ellipse centered in cr // with radiuses ra and rb type Ellipse struct { Item raster RasterItem backing Backing cr raster.Point ra, rb raster.Fix32 width raster.Fix32 pts pointVec }...
Go
package canvas import ( "code.google.com/p/x-go-binding/ui" "image" "image/color" "image/draw" ) // A MoveableItem is an item that may be // moved by calling SetCentre, where the // centre is the central point of the item's // bounding box. // type MoveableItem interface { Item SetCentre(p image.Point) } type ...
Go
package canvas import ( "image" "image/draw" "sync" ) // A Background is the base layer on which other // objects can be layered. It implements the Backing // interface and displays a single object only. type Background struct { lock sync.Mutex r image.Rectangle // overall rectangle (always origin 0, ...
Go
// The canvas package provides some a facility // for managing independently updating objects // inside a graphics window. // // The principal type is Canvas, which displays a // z-ordered set of objects. New objects may be added, // deleted and change their appearance: the Canvas // manages any necessary re-drawing. ...
Go
package canvas import ( "code.google.com/p/freetype-go/freetype/raster" "code.google.com/p/rog-go/values" "code.google.com/p/x-go-binding/ui" "image" "image/color" "image/draw" "math" ) // Box creates a rectangular image of the given size, filled with the given colour, // with a border-size border of colour bo...
Go
package canvas import ( "code.google.com/p/freetype-go/freetype" "code.google.com/p/freetype-go/freetype/raster" "code.google.com/p/freetype-go/freetype/truetype" "code.google.com/p/rog-go/values" "image" "image/draw" ) const ( dpi = 72 gamma = 1 ) type TextItem struct { *freetype.Context Text string Pt...
Go
// Copied with small adaptations from the reflect package in the // Go source tree. // 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. // The deepdiff package implements a version of reflect.DeepEquals that // ...
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 blog implements a web server for articles written in present format. package blog import ( "bytes" "encoding/json" "encoding/xml" "fmt" "html/...
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. // Adapted from encoding/xml/read_test.go. // Package atom defines XML data structures for an Atom feed. package atom import ( "encoding/xml" "time" ) typ...
Go
// +build ignore // mkstdlib generates the zstdlib.go file, containing the Go standard // library API symbols. It's baked into the binary to avoid scanning // GOPATH in the common case. package main import ( "bufio" "bytes" "fmt" "go/format" "io" "log" "os" "path" "path/filepath" "regexp" "sort" "strings"...
Go
// +build go1.2 // 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. // Hacked up copy of go/ast/import.go package imports import ( "go/ast" "go/token" "sort" "strconv" ) // sortImports sorts runs of conse...
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 imports import ( "fmt" "go/ast" "go/build" "go/parser" "go/token" "os" "path" "path/filepath" "strings" "sync" "code.google.com/p/go.tools/...
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 imports implements a Go pretty-printer (like package "go/format") // that also adds or removes import statements as necessary. package imports impor...
Go
// +build ignore // 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. // Command mkindex creates the file "pkgindex.go" containing an index of the Go // standard library. The file is intended to be built as part ...
Go
// +build !go1.2 // 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 imports import "go/ast" // Go 1.1 users don't get fancy package grouping. // But this is still gofmt-compliant: var sortImports = a...
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 oracle import ( "fmt" "go/ast" "go/token" "reflect" "sort" "strings" "code.google.com/p/go.tools/go/types" "code.google.com/p/go.tools/oracle/...
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 oracle contains the implementation of the oracle tool whose // command-line is provided by code.google.com/p/go.tools/cmd/oracle. // // http://golang...
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 oracle import ( "fmt" "go/ast" "go/token" "sort" "code.google.com/p/go.tools/go/ssa" "code.google.com/p/go.tools/go/ssa/ssautil" "code.google.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 oracle import ( "fmt" "go/ast" "go/token" "code.google.com/p/go.tools/go/types" "code.google.com/p/go.tools/oracle/serial" ) // definition repor...
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 oracle import ( "fmt" "go/token" "code.google.com/p/go.tools/go/callgraph" "code.google.com/p/go.tools/go/ssa" "code.google.com/p/go.tools/oracle...
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 oracle import ( "fmt" "go/ast" "go/token" "sort" "code.google.com/p/go.tools/go/ssa" "code.google.com/p/go.tools/go/types" "code.google.com/p/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 serial defines the oracle's schema for structured data // serialization using JSON, XML, etc. package serial // All 'pos' strings are of the form "f...
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 oracle import ( "bytes" "go/ast" "go/printer" "go/token" "sort" "code.google.com/p/go.tools/go/types" "code.google.com/p/go.tools/oracle/serial...
Go
package oracle // This file defines utilities for working with file positions. import ( "fmt" "go/parser" "go/token" "os" "path/filepath" "strconv" "strings" "code.google.com/p/go.tools/astutil" ) // parseOctothorpDecimal returns the numeric value if s matches "#%d", // otherwise -1. func parseOctothorpDeci...
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 oracle import ( "fmt" "go/ast" "go/token" "sort" "code.google.com/p/go.tools/astutil" "code.google.com/p/go.tools/go/loader" "code.google.com/p...
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 oracle import ( "fmt" "go/token" "code.google.com/p/go.tools/go/callgraph" "code.google.com/p/go.tools/go/ssa" "code.google.com/p/go.tools/oracle...
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 oracle import ( "fmt" "go/ast" "go/token" "sort" "code.google.com/p/go.tools/go/types" "code.google.com/p/go.tools/oracle/serial" ) // Referrer...
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 oracle import ( "fmt" "go/token" "sort" "code.google.com/p/go.tools/go/callgraph" "code.google.com/p/go.tools/go/ssa" "code.google.com/p/go.tool...
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 oracle import ( "fmt" "go/ast" "go/build" "go/token" "os" "path/filepath" "sort" "strings" "code.google.com/p/go.tools/astutil" "code.google...
Go