code
stringlengths
10
1.34M
language
stringclasses
1 value
// 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 heap provides heap operations for any type that implements // heap.Interface. A heap is a tree with the property that each node is the // highest-val...
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 ring implements operations on circular lists. package ring // A Ring is an element of a circular list, or ring. // Rings do not have a beginning or ...
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 xml import ( "fmt" "reflect" "strings" "sync" ) // typeInfo holds details for the xml representation of a type. type typeInfo struct { xmlname *...
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 xml import ( "bytes" "errors" "reflect" "strconv" "strings" "time" ) // BUG(rsc): Mapping between XML elements and data structures is inherentl...
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 xml import ( "bufio" "bytes" "fmt" "io" "reflect" "strconv" "strings" "time" ) const ( // A generic XML header suitable for use with the outp...
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 xml implements a simple XML 1.0 parser that // understands XML name spaces. package xml // References: // Annotated XML spec: http://www.xml.com/...
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 binary implements translation between numbers and byte sequences // and encoding and decoding of varints. // // Numbers are translated by reading an...
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 binary // This file implements "varint" encoding of 64-bit integers. // The encoding is: // - unsigned integers are serialized 7 bits at a time, start...
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 ascii85 implements the ascii85 data encoding // as used in the btoa tool and Adobe's PostScript and PDF document formats. package ascii85 import ( ...
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 asn1 import ( "reflect" "strconv" "strings" ) // ASN.1 objects have metadata preceding them: // the tag: the type of the object // a flag denot...
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 asn1 import ( "bytes" "fmt" "io" "math/big" "reflect" "time" ) // A forkableWriter is an in-memory buffer that can be // 'forked' to create new ...
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 asn1 implements parsing of DER-encoded ASN.1 data structures, // as defined in ITU-T Rec X.690. // // See also ``A Layman's Guide to a Subset of ASN....
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 hex implements hexadecimal encoding and decoding. package hex import ( "bytes" "errors" "fmt" "io" ) const hextable = "0123456789abcdef" // En...
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. // Package json implements encoding and decoding of JSON objects as defined in // RFC 4627. // // See "JSON and Go" for an introduction to this package: // htt...
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. package json import ( "errors" "io" ) // A Decoder reads and decodes JSON objects from an input stream. type Decoder struct { r io.Reader buf []byte ...
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. package json // JSON value parser state machine. // Just about at the limit of what is reasonable to write by hand. // Some parts are a bit tedious, but overa...
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. package json import "bytes" // Compact appends to dst the JSON-encoded src with // insignificant space characters elided. func Compact(dst *bytes.Buffer, src...
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. // Represents JSON data structure using native Go types: booleans, floats, // strings, arrays, and maps. package json import ( "encoding/base64" "errors" "...
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 json import ( "strings" ) // tagOptions is the string following a comma in a struct field's "json" // tag, or the empty string. It does not include 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 gob import ( "bytes" "math" "reflect" "unsafe" ) const uint64Size = int(unsafe.Sizeof(uint64(0))) // encoderState is the global execution state o...
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 gob import "fmt" // Errors in decoding and encoding are handled using panic and recover. // Panics caused by user error (that is, everything except ru...
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 gob import ( "bufio" "bytes" "errors" "io" "reflect" "sync" ) // A Decoder manages the receipt of type and data information read from the // rem...
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 ignore package main // Need to compile package gob with debug.go to build this program. // See comments in debug.go for how to do this. import ( "...
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 gob import ( "bytes" "errors" "io" "reflect" "sync" ) // An Encoder manages the transmission of type and data information to the // other side of...
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. // Delete the next line to include in the gob package. // +build ignore package gob // This file is not normally included in the gob package. Used only for d...
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 gob import ( "errors" "fmt" "os" "reflect" "sync" "unicode" "unicode/utf8" ) // userTypeInfo stores the information associated with a type the ...
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 gob // TODO(rsc): When garbage collector changes, revisit // the allocations in this file that use unsafe.Pointer. import ( "bytes" "errors" "io" ...
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 gob manages streams of gobs - binary values exchanged between an Encoder (transmitter) and a Decoder (receiver). A typical use is transporting argum...
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 pem implements the PEM data encoding, which originated in Privacy // Enhanced Mail. The most common use of PEM encoding today is in TLS keys and // c...
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 base64 implements base64 encoding as specified by RFC 4648. package base64 import ( "io" "strconv" ) /* * Encodings */ // An Encoding is a rad...
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 csv import ( "bufio" "io" "strings" "unicode" "unicode/utf8" ) // A Writer writes records to a CSV encoded file. // // As returned by NewWriter, ...
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 csv reads and writes comma-separated values (CSV) files. // // A csv file contains zero or more records of one or more fields per record. // Each rec...
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 base32 implements base32 encoding as specified by RFC 4648. package base32 import ( "io" "strconv" ) /* * Encodings */ // An Encoding is a rad...
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. package fmt import ( "errors" "io" "math" "os" "reflect" "strconv" "unicode/utf8" ) // runeUnreader is the interface to something that can unread runes...
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 fmt import ( "errors" "io" "os" "reflect" "sync" "unicode/utf8" ) // Some constants in the form of bytes, to avoid string overhead. // Needlessl...
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 fmt import ( "strconv" "unicode/utf8" ) const ( nByte = 64 ldigits = "0123456789abcdef" udigits = "0123456789ABCDEF" ) const ( signed = true...
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 fmt implements formatted I/O with functions analogous to C's printf and scanf. The format 'verbs' are derived from C's but are simpler. Printi...
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 quick implements utility functions to help with black box testing. package quick import ( "flag" "fmt" "math" "math/rand" "reflect" "strings" ...
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 iotest import "io" // TruncateWriter returns a Writer that writes to w // but stops silently after n bytes. func TruncateWriter(w io.Writer, n int64) ...
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 iotest implements Readers and Writers useful mainly for testing. package iotest import ( "errors" "io" ) // OneByteReader returns a Reader that i...
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 iotest import ( "io" "log" ) type writeLogger struct { prefix string w io.Writer } func (l *writeLogger) Write(p []byte) (n int, err error) ...
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 testing import ( "flag" "fmt" "os" "runtime" "time" ) var matchBenchmarks = flag.String("test.bench", "", "regular expression to select benchmark...
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 testing import ( "bytes" "fmt" "io" "os" "strings" "time" ) type InternalExample struct { Name string F func() Output string } func R...
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 testing provides support for automated testing of Go packages. // It is intended to be used in concert with the ``go test'' command, which automates ...
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 plan9 package os func itoa(val int) string { // do it here rather than with fmt to avoid dependency if val < 0 { return "-" + itoa(-val) } var ...
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. // Linux-specific package os func hostname() (name string, err error) { f, err := Open("/proc/sys/kernel/hostname") if err != nil { return "", err } def...
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 os import ( "syscall" ) // Getwd returns a rooted path name corresponding to the // current directory. If the current directory can be // reached vi...
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 os import ( "errors" "runtime" "syscall" "time" ) var ErrPlan9 = errors.New("unimplemented on Plan 9") // File represents an open file descriptor...
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 os import ( "syscall" "time" ) func sameFile(sys1, sys2 interface{}) bool { a := sys1.(*Dir) b := sys2.(*Dir) return a.Qid.Path == b.Qid.Path && ...
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 darwin freebsd linux netbsd openbsd package os import ( "runtime" "syscall" ) // File represents an open file descriptor. type File struct { *fi...
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 os import "syscall" func hostname() (name string, err error) { s, e := syscall.ComputerName() if e != nil { return "", NewSyscallError("ComputerN...
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. // Process etc. package os import "syscall" // Args hold the command-line arguments, starting with the program name. var Args []string // Getuid returns the...
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 !cgo,!windows package user import ( "fmt" "runtime" ) func init() { implemented = false } func Current() (*User, error) { return nil, fmt.Erro...
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 user import ( "fmt" "syscall" "unsafe" ) func lookupFullName(domain, username, domainAndUser string) (string, error) { // try domain controller fi...
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 darwin freebsd linux // +build cgo package user import ( "fmt" "runtime" "strconv" "strings" "syscall" "unsafe" ) /* #include <unistd.h> #inc...
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 user allows user account lookups by name or id. package user import ( "strconv" ) var implemented = true // set to false by lookup_stubs.go's init...
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 darwin freebsd netbsd openbsd // os code shared between *BSD systems including OS X (Darwin) // and FreeBSD. package os import "syscall" func host...
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. // +build plan9 package signal import "os" func enableSignal(sig os.Signal) {}
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. // +build darwin freebsd linux netbsd openbsd windows package signal import ( "os" "syscall" ) // In assembly. func signal_enable(uint32) func signal_recv(...
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 signal implements access to incoming signals. package signal // BUG(rsc): This package is not yet implemented on Plan 9 and Windows. import ( "os"...
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 os const ( PathSeparator = '/' // OS-specific path separator PathListSeparator = 0 // OS-specific path list separator ) // IsPathSeparator ret...
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. // Plan 9-specific package os func hostname() (name string, err error) { f, err := Open("#c/sysname") if err != nil { return "", err } defer f.Close() ...
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 os const ( PathSeparator = '\\' // OS-specific path separator PathListSeparator = ';' // OS-specific path list separator ) // IsPathSeparator r...
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 darwin freebsd linux netbsd openbsd package os import "syscall" func isExist(err error) bool { if pe, ok := err.(*PathError); ok { err = pe.Err ...
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 os import ( "syscall" "time" ) func sameFile(sys1, sys2 interface{}) bool { stat1 := sys1.(*syscall.Stat_t) stat2 := sys2.(*syscall.Stat_t) retur...
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 os import ( "errors" ) // Portable analogs of some common system call errors. var ( ErrInvalid = errors.New("invalid argument") ErrPermission = ...
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. package exec import ( "errors" "os" "strings" ) // ErrNotFound is the error resulting if a path search failed to find an executable file. var ErrNotFound ...
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 exec import ( "errors" "os" "strings" "syscall" ) // ErrNotFound is the error resulting if a path search failed to find an executable file. var 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. // Package exec runs external commands. It wraps os.StartProcess to make it // easier to remap stdin and stdout, connect I/O with pipes, and do other // adjustm...
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. // +build darwin freebsd linux netbsd openbsd package exec import ( "errors" "os" "strings" ) // ErrNotFound is the error resulting if a path search fail...
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 os import ( "syscall" "time" ) func sameFile(sys1, sys2 interface{}) bool { stat1 := sys1.(*syscall.Stat_t) stat2 := sys2.(*syscall.Stat_t) retur...
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 os import ( "errors" "io" "syscall" ) var errShortStat = errors.New("short stat message") var errBadStat = errors.New("bad stat message format") 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. // +build darwin freebsd linux netbsd openbsd package os import ( "errors" "runtime" "syscall" "time" ) func (p *Process) wait() (ps *ProcessState, err 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. package os func (file *File) readdirnames(n int) (names []string, err error) { fis, err := file.Readdir(n) names = make([]string, len(fis)) for i, fi := ran...
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 os import ( "sync" "syscall" "time" "unsafe" ) // Stat returns the FileInfo structure describing file. // If there is an error, it will be of type...
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 os import "syscall" func isExist(err error) bool { if pe, ok := err.(*PathError); ok { err = pe.Err } return err == syscall.ERROR_ALREADY_EXISTS ...
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 os import ( "errors" "runtime" "syscall" "time" "unsafe" ) func (p *Process) wait() (ps *ProcessState, err error) { s, e := syscall.WaitForSingl...
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 os import ( "io" "runtime" "sync" "syscall" "unicode/utf16" ) // File represents an open file descriptor. type File struct { *file } // file is...
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 os import ( "runtime" "syscall" ) // Process stores the information about a process created by StartProcess. type Process struct { Pid int hand...
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 os import ( "errors" "runtime" "syscall" "time" ) func startProcess(name string, argv []string, attr *ProcAttr) (p *Process, err error) { sysattr...
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 darwin freebsd linux netbsd openbsd windows package os import ( "syscall" ) func startProcess(name string, argv []string, attr *ProcAttr) (p *Proc...
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 darwin freebsd linux netbsd openbsd package os const ( PathSeparator = '/' // OS-specific path separator PathListSeparator = ':' // OS-specifi...
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 os import ( "io" "syscall" ) // MkdirAll creates a directory named path, // along with any necessary parents, and returns nil, // or else returns an...
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 os import ( "syscall" "time" ) func sameFile(sys1, sys2 interface{}) bool { stat1 := sys1.(*syscall.Stat_t) stat2 := sys2.(*syscall.Stat_t) retur...
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 os provides a platform-independent interface to operating system // functionality. The design is Unix-like, although the error handling is // Go-like...
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 darwin freebsd linux netbsd openbsd windows package os import ( "syscall" "time" ) func sigpipe() // implemented in package runtime func epipech...
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 darwin freebsd linux netbsd openbsd package os import ( "io" "syscall" ) const ( blockSize = 4096 ) func (f *File) readdirnames(n int) (names [...
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. // General environment variables. package os import "syscall" // Expand replaces ${var} or $var in the string based on the mapping function. // Invocations ...
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 os import ( "syscall" "time" ) func sameFile(sys1, sys2 interface{}) bool { stat1 := sys1.(*syscall.Stat_t) stat2 := sys2.(*syscall.Stat_t) retur...
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 os import ( "syscall" "time" ) func sameFile(sys1, sys2 interface{}) bool { stat1 := sys1.(*syscall.Stat_t) stat2 := sys2.(*syscall.Stat_t) retur...
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 os import ( "syscall" "time" ) // Getpagesize returns the underlying system's memory page size. func Getpagesize() int { return syscall.Getpagesize(...
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 os func isExist(err error) bool { if pe, ok := err.(*PathError); ok { err = pe.Err } return contains(err.Error(), " exists") } func isNotExist(er...
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 os import "time" // FindProcess looks for a running process by its pid. // The Process it returns can be used to obtain information // about the under...
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 tabwriter implements a write filter (tabwriter.Writer) that // translates tabbed columns in input into properly aligned text. // // The package is us...
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. // Helper functions to make constructing templates easier. package template import ( "fmt" "io/ioutil" "path/filepath" ) // Functions and methods to parse...
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 template import ( "bytes" "fmt" "io" "net/url" "reflect" "strings" "unicode" "unicode/utf8" ) // FuncMap is the type of the map defining the m...
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 template import ( "fmt" "io" "reflect" "runtime" "sort" "strings" "text/template/parse" ) // state represents the state of an execution. It's n...
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 template import ( "fmt" "reflect" "text/template/parse" ) // common holds the information shared by related templates. type common struct { tmpl m...
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. // Parse nodes. package parse import ( "bytes" "fmt" "strconv" "strings" ) // A node is an element in the parse tree. The interface is trivial. type Node...
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 parse import ( "fmt" "strings" "unicode" "unicode/utf8" ) // item represents a token or text string returned from the scanner. type item struct { ...
Go