code
stringlengths
10
1.34M
language
stringclasses
1 value
// 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 math // Signbit returns true if x is negative or negative zero. func Signbit(x float64) bool { return Float64bits(x)&(1<<63) != 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. package math /* Floating-point hyperbolic tangent. Sinh and Cosh are called except for large arguments, which would cause overflow improperly. */ // Tanh ...
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 math /* The algorithm is based in part on "Optimal Partitioning of Newton's Method for Calculating Roots", by Gunter Meinardus and G. D. Taylor, Mat...
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 math /* Floating-point tangent. */ // The original C code, the long comment, and the constants // below were from http://netlib.sandia.gov/cephes/cma...
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 math // Sqrt returns the square root of x. // // Special cases are: // Sqrt(+Inf) = +Inf // Sqrt(±0) = ±0 // Sqrt(x < 0) = NaN // Sqrt(NaN) = NaN func ...
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 math /* Floating-point logarithm. */ // The original C code, the long comment, and the constants // below are from FreeBSD's /usr/src/lib/msun/src/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 math // Ldexp is the inverse of Frexp. // It returns frac × 2**exp. // // Special cases are: // Ldexp(±0, exp) = ±0 // Ldexp(±Inf, exp) = ±Inf // Ldexp...
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 math func Ceil(x float64) float64 func Floor(x float64) float64 func Trunc(x float64) float64
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 math // The original C code, the long comment, and the constants // below are from http://netlib.sandia.gov/cephes/cprob/gamma.c. // The go code is a s...
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 math /* Hypot -- sqrt(p*p + q*q), but overflows only if the result does. */ // Hypot computes Sqrt(p*p + q*q), taking care to avoid // unnecessary 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 math /* Floating-point logarithm of the Gamma function. */ // The original C code and the long comment below are // from FreeBSD's /usr/src/lib/msun/...
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 math func Log1p(x float64) float64
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 math /* Bessel function of the first and second kinds of order zero. */ // The original C code and the long comment below are // from FreeBSD's /usr/...
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 math provides basic constants and mathematical functions. package math // Mathematical constants. // Reference: http://www.research.att.com/~njas/se...
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 math // Abs returns the absolute value of x. // // Special cases are: // Abs(±Inf) = +Inf // Abs(NaN) = NaN func Abs(x float64) float64 { switch { ca...
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 math /* Bessel function of the first and second kinds of order one. */ // The original C code and the long comment below are // from FreeBSD's /usr/s...
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 math // The original C code, the long comment, and the constants // below are from FreeBSD's /usr/src/lib/msun/src/e_atanh.c // and came with this noti...
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 math // Copysign(x, y) returns a value with the magnitude // of x and the sign of y. func Copysign(x, y float64) float64 { const sign = 1 << 63 retur...
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 math func Remainder(x, y float64) float64
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 math /* Bessel function of the first and second kinds of order n. */ // The original C code and the long comment below are // from FreeBSD's /usr/src...
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 math func Sqrt(x float64) float64
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 math /* Floating-point arctangent. Atan returns the value of the arctangent of its argument in the range [-pi/2,pi/2]. There are no error returns....
Go
// Copyright 2009-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 math /* Floating-point mod function. */ // Mod returns the floating-point remainder of x/y. // The magnitude of the result is less than y and it...
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 math func Log10(x float64) float64 func Log2(x float64) float64
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 math /* Floating-point arcsine and arccosine. They are implemented by computing the arctangent after appropriate range reduction. */ // Asin 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 rand import ( "math" ) /* * Exponential distribution * * See "The Ziggurat Method for Generating Random Variables" * (Marsaglia & Tsang, 2000) *...
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. // W.Hormann, G.Derflinger: // "Rejection-Inversion to Generate Variates // from Monotone Discrete Distributions" // http://eeyore.wu-wien.ac.at/papers/96-04-04...
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 rand implements pseudo-random number generators. package rand import "sync" // A Source represents a source of uniformly-distributed // pseudo-rand...
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 rand import ( "math" ) /* * Normal distribution * * See "The Ziggurat Method for Generating Random Variables" * (Marsaglia & Tsang, 2000) * http...
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 rand /* * Uniform distribution * * algorithm by * DP Mitchell and JA Reeds */ const ( _LEN = 607 _TAP = 273 _MAX = 1 << 63 _MASK = _MAX - ...
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 math // This table might overflow 127-bit exponent representations. // In that case, truncate it after 1.0e38. var pow10tab [70]float64 // Pow10 retur...
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 math // The original C code and the the comment below are from // FreeBSD's /usr/src/lib/msun/src/e_remainder.c and came // with this notice. The go c...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package math // Dim returns the maximum of x-y or 0. // // Special cases are: // Dim(+Inf, +Inf) = NaN // Dim(-Inf, -Inf) = NaN // Dim(x, NaN) = Dim(NaN, x) = ...
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 math // Logb(x) returns the binary exponent of x. // // Special cases are: // Logb(±Inf) = +Inf // Logb(0) = -Inf // Logb(NaN) = NaN func Logb(x float6...
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 math func Abs(x float64) float64
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 math // Nextafter returns the next representable value after x towards y. // If x == y, then x is returned. // // Special cases are: // Nextafter(NaN, ...
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 math func Log(x float64) float64
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 math // The original C code, the long comment, and the constants // below are from FreeBSD's /usr/src/lib/msun/src/s_asinh.c // and came with this noti...
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 math // Atan2 returns the arc tangent of y/x, using // the signs of the two to determine the quadrant // of the return value. // // Special cases are (...
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 math func Tan(x float64) float64
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 flag implements command-line flag parsing. Usage: Define flags using flag.String(), Bool(), Int(), etc. Example: import "flag" var ip *int =...
Go
package patch import ( "bytes" "errors" ) type TextDiff []TextChunk // A TextChunk specifies an edit to a section of a file: // the text beginning at Line, which should be exactly Old, // is to be replaced with New. type TextChunk struct { Line int Old []byte New []byte } func ParseTextDiff(raw []byte) (Text...
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 patch implements parsing and execution of the textual and // binary patch descriptions used by version control tools such as // CVS, Git, Mercurial,...
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 patch import "os" // An Op is a single operation to execute to apply a patch. type Op struct { Verb Verb // action Src string // source file Ds...
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 patch import ( "bytes" "compress/zlib" "crypto/sha1" "encoding/git85" "errors" "fmt" "io" ) func gitSHA1(data []byte) []byte { if len(data) =...
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 time import "syscall" // Sleep pauses the current goroutine for the duration d. func Sleep(d Duration) // readFile reads and returns the content of 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 time provides functionality for measuring and displaying time. // // The calendrical calculations always assume a Gregorian calendar. package time /...
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 time func nano() int64 { sec, nsec := now() return sec*1e9 + int64(nsec) } // Interface to timers implemented in package runtime. // Must be in sync...
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 time // for testing: whatever interrupts a sleep func interrupt() { // cannot predict pid, don't want to kill group }
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 openbsd // Parse "zoneinfo" time zone file. // This is a fairly standard file format used on OS X, Linux, BSD, Sun, and others. ...
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 openbsd package time import "syscall" // for testing: whatever interrupts a sleep func interrupt() { syscall.Kill(syscall.Get...
Go
package time import "errors" const ( numeric = iota alphabetic separator plus minus ) // These are predefined layouts for use in Time.Format. // The standard time used in the layouts is: // Mon Jan 2 15:04:05 MST 2006 (MST is GMT-0700) // which is Unix time 1136243045. // (Think of it as 01/02 03:04:05PM '06 -...
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 time import ( "errors" "syscall" ) // TODO(rsc): Fall back to copy of zoneinfo files. // BUG(brainman,rsc): On Windows, the operating system does n...
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 time import "errors" // A Ticker holds a synchronous channel that delivers `ticks' of a clock // at intervals. type Ticker struct { C <-chan 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 time import "sync" // A Location maps time instants to the zone in use at that time. // Typically, the Location represents the collection of time offs...
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 time // for testing: whatever interrupts a sleep func interrupt() { }
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 Plan 9 timezone(2) files. package time //import ( // "strconv" // "strings" //) func parseZones(s string) (zt []zonetime) { f := strings.Fields(s) ...
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 net import ( "io" "os" "syscall" ) type sendfileOp struct { anOp src syscall.Handle // source n uint32 } func (o *sendfileOp) Submit() (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. // +build darwin freebsd linux openbsd windows // Sockets package net import ( "io" "os" "reflect" "syscall" ) // Boolean to int. func boolint(b bool) ...
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. // TCP sockets package net // TCPAddr represents the address of a TCP end point. type TCPAddr struct { IP IP Port int } // Network returns the address's...
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 net import ( "os" "sync" "syscall" "unsafe" ) var ( protoentLock sync.Mutex hostentLock sync.Mutex serventLock sync.Mutex ) // lookupProtoco...
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. // Sockets for Windows package net import ( "syscall" ) func setKernelSpecificSockopt(s syscall.Handle, f int) { // Windows will reuse recently-used addre...
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 openbsd windows // UDP sockets package net import ( "bytes" "os" "syscall" ) func sockaddrToUDP(sa syscall.Sockaddr) Addr...
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 net import ( "os" ) // FileConn returns a copy of the network connection corresponding to // the open file f. It is the caller's responsibility to c...
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 mail implements parsing of mail messages. For the most part, this package follows the syntax as specified by RFC 5322. Notable divergences: * Obsol...
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 URL parses URLs and implements query escaping. // See RFC 3986. package url import ( "errors" "strconv" "strings" ) // Error reports an error 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. // +build darwin freebsd linux package net /* #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <stdlib.h> #...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package net func resolveNetAddr(op, net, addr string) (a Addr, err error) { if addr == "" { return nil, &OpError{op, net, nil, errMissingAddress} } switc...
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 openbsd // Sockets for BSD variants package net import ( "syscall" ) func setKernelSpecificSockopt(s, f int) { // Allow reuse of...
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 openbsd package net import ( "errors" "sync" ) var ( protocols map[string]int onceReadProtocols sync.Once ) // r...
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. // (Raw) IP sockets stubs for Plan 9 package net import ( "os" ) // IPConn is the implementation of the Conn and PacketConn // interfaces for IP network 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. // +build darwin freebsd linux openbsd windows // Unix domain sockets package net import ( "os" "syscall" ) func unixSocket(net string, laddr, raddr *Uni...
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 openbsd // Network interface identification for BSD variants package net import ( "os" "syscall" "unsafe" ) // If the ifindex 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 rpc import ( "bufio" "encoding/gob" "errors" "io" "log" "net" "net/http" "sync" ) // ServerError represents an error that has been returned fr...
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 jsonrpc implements a JSON-RPC ClientCodec and ServerCodec // for the rpc package. package jsonrpc import ( "encoding/json" "fmt" "io" "net" "n...
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 jsonrpc import ( "encoding/json" "errors" "io" "net/rpc" "sync" ) type serverCodec struct { dec *json.Decoder // for reading JSON values enc *...
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 rpc /* Some HTML presented at http://machine:port/debug/rpc Lists services, their methods, and some statistics, still rudimentary. */ import ( "fmt...
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 rpc provides access to the exported methods of an object across a network or other I/O connection. A server registers an object, making it visible...
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 openbsd package net import "io" func sendFile(c *netFD, r io.Reader) (n int64, err error, handled bool) { return 0, nil, false }
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. // Network interface identification for Darwin package net import ( "os" "syscall" ) // If the ifindex is zero, interfaceMulticastAddrTable returns // add...
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 openbsd package net import ( "os" "syscall" ) func newPollServer() (s *pollServer, err error) { s = new(pollServer) s.cr =...
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. // Network interface identification for OpenBSD package net // If the ifindex is zero, interfaceMulticastAddrTable returns // addresses for all network inter...
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 net import ( "io" "os" "syscall" ) // maxSendfileSize is the largest chunk size we ask the kernel to copy // at a time. const maxSendfileSize int ...
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 openbsd // DNS client: see RFC 1035. // Has to be linked into package net for Dial. // TODO(rsc): // Check periodically whether...
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. // UDP sockets package net // UDPAddr represents the address of a UDP end point. type UDPAddr struct { IP IP Port int } // Network returns the address's...
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 textproto import ( "bufio" "fmt" "io" ) // A Writer implements convenience methods for writing // requests or responses to a text protocol network...
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 textproto import ( "sync" ) // A Pipeline manages a pipelined in-order request/response sequence. // // To use a Pipeline p to manage multiple clien...
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 textproto import ( "bufio" "bytes" "io" "io/ioutil" "strconv" "strings" ) // BUG(rsc): To let callers manage exposure to denial of service // 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 textproto implements generic support for text-based request/response // protocols in the style of HTTP, NNTP, and SMTP. // // The package provides: ...
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 textproto // A MIMEHeader represents a MIME-style header mapping // keys to sets of values. type MIMEHeader map[string][]string // Add adds the key, ...
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 package net /* #include <netdb.h> */ import "C" func cgoAddrInfoMask() C.int { return C.AI_MASK }
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 smtp import "errors" // Auth is implemented by an SMTP authentication mechanism. type Auth interface { // Start begins an authentication with a serve...
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 smtp implements the Simple Mail Transfer Protocol as defined in RFC 5321. // It also implements the following extensions: // 8BITMIME RFC 1652 // AU...
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 openbsd // Read system port mappings from /etc/services package net import "sync" var services map[string]map[string]int 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. // IP sockets package net var supportsIPv6, supportsIPv4map = probeIPv6Stack() func firstFavoriteAddr(filter func(IP) IP, addrs []string) (addr IP) { if 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. // +build darwin freebsd linux openbsd // Read system DNS config from /etc/resolv.conf package net type dnsConfig struct { servers []string // servers to u...
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. // IP sockets stubs for Plan 9 package net import ( "errors" "io" "os" ) // probeIPv6Stack returns two boolean values. If the first boolean value 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. // Waiting for FDs via epoll(7). package net import ( "os" "syscall" ) const ( readFlags = syscall.EPOLLIN | syscall.EPOLLRDHUP writeFlags = syscall.EPO...
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 openbsd package net import ( "os" "syscall" ) func newFileFD(f *os.File) (nfd *netFD, err error) { fd, errno := syscall.Dup...
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. // HTTP Response reading and parsing. package http import ( "bufio" "errors" "io" "net/textproto" "net/url" "strconv" "strings" ) var respExcludeHeade...
Go