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 jpeg implements a JPEG image decoder and encoder. // // JPEG is defined in ITU-T T.81: http://www.w3.org/Graphics/JPEG/itu-t81.pdf. package jpeg imp...
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 jpeg // This file implements a Forward Discrete Cosine Transformation. /* It is based on the code in jfdctint.c from the Independent JPEG Group, found...
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 jpeg // This is a Go translation of idct.c from // // http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_IEC_13818-4_2004_Conformance_Testing...
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 tiff import ( "bufio" "io" ) type byteReader interface { io.Reader io.ByteReader } // unpackBits decodes the PackBits-compressed data in src and ...
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 tiff implements a TIFF image decoder. // // The TIFF specification is at http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf package tiff i...
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 tiff import "io" // buffer buffers an io.Reader to satisfy io.ReaderAt. type buffer struct { r io.Reader buf []byte } func (b *buffer) ReadAt(p [...
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 tiff // A tiff image file contains one or more images. The metadata // of each image is contained in an Image File Directory (IFD), // which contains 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 scanner provides a scanner and tokenizer for UTF-8-encoded text. // It takes an io.Reader providing the source, which then can be tokenized // throug...
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. package template import ( "fmt" "io" "reflect" "runtime" "strings" "text/template/parse" ) // state represents the state of an execution. It's not part ...
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 builds parse trees for templates. The grammar is defined // in the documents for the template package. package parse import ( "bytes" "fmt"...
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
// 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. // 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 implements data-driven templates for generating textual output such as HTML. Templates are executed by applying them to a data structure. A...
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 suffixarray implements substring search in logarithmic time using // an in-memory suffix array. // // Example use: // // // create index for some dat...
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 algorithm is based on "Faster Suffix Sorting" // by N. Jesper Larsson and Kunihiko Sadakane // paper: http://www.larsson.dogma.net/ssrev-tr.pdf // cod...
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 unsafe contains operations that step around the type safety of Go programs. */ package unsafe // ArbitraryType is here for the purposes of document...
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 script aids in the testing of code that uses channels. package script import ( "fmt" "math/rand" "reflect" "strings" ) // An Event is an elemen...
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" "time" ) type InternalExample struct { Name string F func() Output string } func RunExamples(...
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 only for testing. package iotest import ( "errors" "io" ) // OneByteReader returns a Reader that imp...
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 provides support for automated testing of Go packages. // It is intended to be used in concert with the ``gotest'' utility, 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. package testing import ( "flag" "fmt" "os" "runtime" "time" ) var matchBenchmarks = flag.String("test.bench", "", "regular expression to select benchmark...
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 ( "errors" "exp/types" "flag" "fmt" "go/ast" "go/parser" "go/scanner" "go/token" "io/ioutil" "os" "path/filepath" "strings" ) ...
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 similar to the analysis performed by the front-end of a Go compiler. Errors ...
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 inotify implements a wrapper for the Linux inotify system. Example: watcher, err := inotify.NewWatcher() if err != nil { log.Fatal(e...
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 ssh // Session implements an interactive session described in // "RFC 4254, section 6". import ( "bytes" "errors" "fmt" "io" "io/ioutil" ) type ...
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 ssh import ( "errors" "io" "sync" ) // A Channel is an ordered, reliable, duplex stream that is multiplexed over an // SSH connection. type Channel...
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 ssh import ( "crypto/aes" "crypto/cipher" "crypto/rc4" ) // streamDump is used to dump the initial keystream for stream ciphers. It is a // a write...
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 ssh import ( "bufio" "crypto" "crypto/cipher" "crypto/hmac" "crypto/subtle" "errors" "hash" "io" "net" "sync" ) const ( packetSizeMultiple ...
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 ssh import ( "crypto" "crypto/rand" "errors" "fmt" "io" "math/big" "net" "sync" ) // clientVersion is the fixed identification string that 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. package ssh import ( "crypto/dsa" "crypto/rsa" "math/big" "strconv" "sync" ) // These are string constants in the SSH protocol. const ( kexAlgoDH14SHA1 ...
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 ssh import ( "bytes" "io" "math/big" "reflect" ) // These are SSH message type numbers. They are scattered around several // documents but many we...
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 ssh import "io" // ServerShell contains the state for running a VT100 terminal that is capable // of reading lines of input. type ServerShell struct {...
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 ssh import ( "bytes" "crypto" "crypto/rand" "crypto/rsa" "crypto/x509" "encoding/pem" "errors" "io" "math/big" "net" "sync" ) type ServerCo...
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 ssh import ( "errors" "fmt" "io" "net" ) // Dial initiates a connection to the addr from the remote host. // addr is resolved using net.ResolveTCPA...
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 ssh import ( "errors" "io" ) // authenticate authenticates with the remote server. See RFC 4252. func (c *ClientConn) authenticate(session []byte) e...
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 ssh implements an SSH client and server. SSH is a transport security protocol, an authentication protocol and a family of application protocols. 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. package spdy import ( "encoding/binary" "io" "net/http" "strings" ) func (frame *SynStreamFrame) write(f *Framer) error { return f.writeSynStreamFrame(fr...
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 spdy import ( "bytes" "compress/zlib" "io" "net/http" ) // Data Frame Format // +----------------------------------+ // |0| Stream-ID (31...
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 spdy import ( "compress/zlib" "encoding/binary" "io" "net/http" "strings" ) func (frame *SynStreamFrame) read(h ControlFrameHeader, f *Framer) er...
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 terminal provides support functions for dealing with terminals, as // commonly found on UNIX systems. // // Putting a terminal into raw mode is 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 terminal import "io" // Terminal contains the state for running a VT100 terminal that is capable of // reading lines of input. type Terminal struct { ...
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 sql provides a generic interface around SQL (or SQL-like) // databases. package sql import ( "errors" "fmt" "io" "sync" "exp/sql/driver" ) va...
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. // Type conversions for Scan. package sql import ( "errors" "exp/sql/driver" "fmt" "reflect" "strconv" ) // subsetTypeArgs takes a slice of arguments fr...
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 driver defines interfaces to be implemented by database // drivers as used by package sql. // // Code simply using databases should use package sql. ...
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 driver import ( "fmt" "reflect" "strconv" ) // ValueConverter is the interface providing the ConvertValue method. // // Various implementations 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. package main import ( "bytes" "exp/ebnf" "flag" "fmt" "go/scanner" "go/token" "io/ioutil" "os" "path/filepath" ) var fset = token.NewFileSet() var st...
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. /* Ebnflint verifies that EBNF productions are consistent and gramatically correct. It reads them from an HTML document such as the Go specification. Grammar ...
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 ebnf import ( "io" "strconv" "text/scanner" ) type parser struct { errors errorList scanner scanner.Scanner pos scanner.Position // token p...
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 ebnf is a library for EBNF grammars. The input is text ([]byte) // satisfying the following grammar (represented itself in EBNF): // // Production =...
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 norm import "io" type normWriter struct { rb reorderBuffer w io.Writer buf []byte } // Write implements the standard write interface. If the l...
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 norm // This file contains Form-specific logic and wrappers for data in tables.go. type runeInfo struct { pos uint8 // start position in reorderBu...
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. // Trie table generator. // Used by make*tables tools to generate a go file with trie data structures // for mapping UTF-8 to a 16-bit value. All but the last b...
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 norm import "unicode/utf8" const ( maxCombiningChars = 30 maxBufferSize = maxCombiningChars + 2 // +1 to hold starter +1 to hold CGJ maxBackRun...
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 ( "bufio" "bytes" "exp/norm" "flag" "fmt" "io" "log" "net/http" "os" "path" "regexp" "runtime" "strconv" "strings" "time" "...
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 norm type valueRange struct { value uint16 // header: value:stride lo, hi byte // header: lo:n } type trie struct { index []uint8 values...
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 norm import "unicode/utf8" type input interface { skipASCII(p int) int skipNonStarter() int appendSlice(buf []byte, s, e int) []byte copySlice(buf...
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. // Generate test data for trie code. package main import ( "fmt" ) func main() { printTestTables() } // We take the smallest, largest and an arbitrary val...
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 norm contains types and functions for normalizing Unicode strings. package norm import "unicode/utf8" // A Form denotes a canonical representation ...
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. // Normalization table generator. // Data read from the web. package main import ( "bufio" "bytes" "flag" "fmt" "io" "log" "net/http" "os" "regexp" ...
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 the Check function, which typechecks a package. package types import ( "fmt" "go/ast" "go/scanner" "go/token" "strconv" ) const ...
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 UNDER CONSTRUCTION. ANY AND ALL PARTS MAY CHANGE. // Package types declares the types used to represent Go types. // package types import ( "go/ast...
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. // FILE UNDER CONSTRUCTION. ANY AND ALL PARTS MAY CHANGE. // This file implements the universe and unsafe package scopes. package types import "go/ast" var (...
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 ExportData. package types import ( "bufio" "errors" "fmt" "io" "os" "strconv" "strings" ) func readGopackHeader(buf *bufio.Rea...
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 an ast.Importer for gc generated object files. // TODO(gri) Eventually move this into a separate package outside types. package types ...
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 operations on ideal constants. package types import ( "go/token" "math/big" "strconv" ) // TODO(gri) Consider changing the API so ...
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 ( "fmt" "os" "syscall" "unsafe" ) // some help functions func abortf(format string, a ...interface{}) { fmt.Fprintf(os.Stdout, forma...
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 ( "syscall" "unsafe" ) type Wndclassex struct { Size uint32 Style uint32 WndProc uintptr ClsExtra int32 WndExtra ...
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 winfsnotify allows the user to receive // file system event notifications on Windows. package winfsnotify import ( "errors" "fmt" "os" "path/fil...
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 builtin provides documentation for Go's predeclared identifiers. The items documented here are not actually in package builtin but their descripti...
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 zlib import ( "compress/flate" "errors" "hash" "hash/adler32" "io" ) // These constants are copied from the flate package, so that code that impo...
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 zlib implements reading and writing of zlib format compressed data, as specified in RFC 1950. The implementation provides filters that uncompress du...
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 flate var reverseByte = [256]byte{ 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, 0x08, 0x88, 0x48,...
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 flate func min(left int, right int) int { if left < right { return left } return right } func minInt32(left int32, right int32) int32 { if left ...
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 flate const ( // 2 bits: type 0 = literal 1=EOF 2=Match 3=Unused // 8 bits: xlength = length - MIN_MATCH_LENGTH // 22 bits xoffset = off...
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 flate implements the DEFLATE compressed data format, described in // RFC 1951. The gzip and zlib packages implement access to DEFLATE-based file // ...
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 flate import ( "io" "math" "strconv" ) const ( // The largest offset code. offsetCodeCount = 30 // The special code used to mark the end of a 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 flate import ( "io" "math" ) const ( NoCompression = 0 BestSpeed = 1 fastCompression = 3 BestCompression = 9 DefaultCompres...
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 flate import ( "math" "sort" ) type huffmanEncoder struct { codeBits []uint8 code []uint16 } type literalNode struct { literal uint16 freq ...
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 bzip2 import ( "bufio" "io" ) // bitReader wraps an io.Reader and provides the ability to read values, // bit-by-bit, from it. Its Read* methods don...
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 bzip2 import "sort" // A huffmanTree is a binary tree which is navigated, bit-by-bit to reach a // symbol. type huffmanTree struct { // nodes contain...
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 bzip2 implements bzip2 decompression. package bzip2 import "io" // There's no RFC for bzip2. I used the Wikipedia page for reference and a lot // o...
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 bzip2 // moveToFrontDecoder implements a move-to-front list. Such a list is an // efficient way to transform a string with repeating elements into one ...
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 gzip import ( "compress/flate" "errors" "hash" "hash/crc32" "io" ) // These constants are copied from the flate package, so that code that 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 gzip implements reading and writing of gzip format compressed files, // as specified in RFC 1952. package gzip import ( "bufio" "compress/flate" ...
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 lzw import ( "bufio" "errors" "fmt" "io" ) // A writer is a buffered, flushable writer. type writer interface { WriteByte(byte) error Flush() er...
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 lzw implements the Lempel-Ziv-Welch compressed data format, // described in T. A. Welch, ``A Technique for High-Performance Data // Compression'', Co...
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 ( "bytes" "errors" "io" "os" "reflect" "sync" "unicode" "unicode/utf8" ) // Some constants in the form of bytes, to avoid string ov...
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 ( "bytes" "errors" "io" "math" "os" "reflect" "strconv" "strings" "unicode" "unicode/utf8" ) // runeUnreader is the interface to ...
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 ( "bytes" "strconv" "unicode" "unicode/utf8" ) const ( nByte = 64 ldigits = "0123456789abcdef" udigits = "0123456789ABCDEF" ) cons...
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. Printin...
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 log implements a simple logging package. It defines a type, Logger, // with methods for formatting output. It also has a predefined 'standard' // Log...
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 syslog provides a simple interface to the system log service. It // can send messages to the syslog daemon using UNIX domain sockets, UDP, or // TCP ...
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 syslog import ( "errors" "net" ) // unixSyslog opens a connection to the syslog daemon running on the // local machine using a Unix domain socket. ...
Go