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 cmplx import "math" // Phase returns the phase (also called the argument) of x. // The returned value is in the range [-Pi, Pi]. func Phase(x complex1...
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 cmplx import "math" // Rect returns the complex number x with polar coordinates r, θ. func Rect(r, θ float64) complex128 { s, c := math.Sincos(θ) re...
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 cmplx // Conj returns the complex conjugate of x. func Conj(x complex128) complex128 { return complex(real(x), -imag(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 cmplx import "math" // The original C code, the long comment, and the constants // below are from http://netlib.sandia.gov/cephes/c9x-complex/clog.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 cmplx import "math" // The original C code, the long comment, and the constants // below are from http://netlib.sandia.gov/cephes/c9x-complex/clog.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 cmplx import "math" // The original C code, the long comment, and the constants // below are from http://netlib.sandia.gov/cephes/c9x-complex/clog.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 cmplx provides basic constants and mathematical functions for // complex numbers. package cmplx import "math" // Abs returns the absolute value (al...
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 cmplx import "math" // The original C code, the long comment, and the constants // below are from http://netlib.sandia.gov/cephes/c9x-complex/clog.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 cmplx import "math" // IsInf returns true if either real(x) or imag(x) is an infinity. func IsInf(x complex128) bool { if math.IsInf(real(x), 0) || m...
Go
// Copyright 2010 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements multi-precision rational numbers. package big import ( "encoding/binary" "errors" "fmt" "strings" ) // A Rat represents a quotien...
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 big implements multi-precision arithmetic (big numbers). // The following numeric types are supported: // // - Int signed integers // - Rat rational ...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file provides Go implementations of elementary multi-precision // arithmetic operations on word vectors. Needed for platforms without // assembly implem...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This file implements signed multi-precision integers. package big import ( "errors" "fmt" "io" "math/rand" "strings" ) // An Int represents a signed ...
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 big // implemented in arith_$GOARCH.s func mulWW(x, y Word) (z1, z0 Word) func divWW(x1, x0, y Word) (q, r Word) func addVV(z, x, y []Word) (c Word) f...
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 // Coefficients _sin[] and _cos[] are found in pkg/math/sin.go. // Sincos returns Sin(x), Cos(x). // // Special cases are: // Sincos(±0) = ±0, 1 ...
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 import "unsafe" // Float32bits returns the IEEE 754 binary representation of f. func Float32bits(f float32) uint32 { return *(*uint32)(unsafe.Poi...
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 // Exp returns e**x, the base-e exponential of x. // // Special cases are: // Exp(+Inf) = +Inf // Exp(NaN) = NaN // Very large values overflow to ...
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 error function and complementary error function. */ // The original C code and the long comment below are // from FreeBSD's /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. package math // Modf returns integer and fractional floating-point numbers // that sum to f. Both values have the same sign as f. // // Special cases are: // ...
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 // Log10 returns the decimal logarithm of x. // The special cases are the same as for Log. func Log10(x float64) float64 func log10(x float64) fl...
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 // Frexp breaks f into a normalized fraction // and an integral power of two. // It returns frac and exp satisfying f == frac × 2**exp, // with th...
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_log1p.c // and came with this noti...
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 sine and cosine. */ // The original C code, the long comment, and the constants // below were from http://netlib.sandia.gov/ce...
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 sine and cosine. The exponential func is called for arguments greater in magnitude than 0.5. A series is used f...
Go
// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package math const ( uvnan = 0x7FF0000000000001 uvinf = 0x7FF0000000000000 uvneginf = 0xFFF0000000000000 mask = 0x7FF shift = 64 - 11 - 1 bi...
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 // 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 // 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 returns Sqrt(p*p + q*q), taking care to avoid // unnecessary ove...
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 /* 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://oeis.org/Axxxxxx const ( 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 // Abs returns the absolute value of x. // // Special cases are: // Abs(±Inf) = +Inf // Abs(NaN) = NaN func Abs(x float64) float64 func abs(x flo...
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 returns a value with the magnitude // of x and the sign of y. func Copysign(x, y float64) float64 { const sign = 1 << 63 return Floa...
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 /* 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 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 returns the binary exponent of x. // // Special cases are: // Logb(±Inf) = +Inf // Logb(0) = -Inf // Logb(NaN) = NaN func Logb(x 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(...
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 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 ( "database/sql/driver" "errors" "fmt" "io" "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. // Type conversions for Scan. package sql import ( "database/sql/driver" "errors" "fmt" "reflect" "strconv" ) // subsetTypeArgs takes a slice of argumen...
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. // // Most code should use package sql. package driver im...
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" "time" ) // ValueConverter is the interface providing the ConvertValue method. // // Various implementat...
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. This declares an integer flag, -flagna...
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 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. // Parse "zoneinfo" time zone file. // This is a fairly standard file format used on OS X, Linux, BSD, Sun, and others. // See tzfile(5), http://en.wikipedia.or...
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 // Sleep pauses the current goroutine for the duration d. func Sleep(d Duration) func nano() int64 { sec, nsec := now() return sec*1e9 + int64(...
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 plan9 package time import ( "errors" "syscall" ) // for testing: whatever interrupts a sleep func interrupt() { // cannot predict pid, don't wan...
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 // Parse "zoneinfo" time zone file. // This is a fairly standard file format used on OS X, Linux, BSD, Sun, and 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. // +build darwin freebsd linux netbsd openbsd package time import ( "errors" "syscall" ) // for testing: whatever interrupts a sleep func interrupt() { sy...
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 time import "errors" // These are predefined layouts for use in Time.Format. // The standard time used in the layouts is: // Mon Jan 2 15:04:05 MST 20...
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" "runtime" "syscall" ) // TODO(rsc): Fall back to copy of zoneinfo files. // BUG(brainman,rsc): On Windows, the operating sy...
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" "syscall" ) // A Location maps time instants to the zone in use at that time. // Typically, the Location represents the collect...
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 ( "errors" "syscall" ) // for testing: whatever interrupts a sleep func interrupt() { } // readFile reads and returns the content of th...
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 ( "errors" "runtime" "syscall" ) func isSpace(r rune) bool { return r == ' ' || r == '\t' || r == ...
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. // Socket options for Windows package net import ( "os" "syscall" ) func setDefaultSockopts(s syscall.Handle, f, t int, ipv6only bool) error { switch f {...
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 netbsd openbsd windows // Sockets package net import ( "io" "syscall" ) var listenerBacklog = maxListenerBacklog() // Gen...
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 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. // Sockets for Windows package net import "syscall" func maxListenerBacklog() int { // TODO: Implement this return syscall.SOMAXCONN } func listenerSocka...
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 // UDP sockets package net import ( "errors" "os" "syscall" "time" ) var ErrWriteToConnected = 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 net import ( "os" "syscall" ) // FileConn returns a copy of the network connection corresponding to // the open file f. It is the caller's responsi...
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 netbsd openbsd // IP-level socket options for BSD variants package net import ( "os" "syscall" ) func ipv4MulticastTTL(fd *netFD...
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. // IP-level socket options for Linux package net import ( "os" "syscall" ) func ipv4MulticastInterface(fd *netFD) (*Interface, error) { if err := fd.incr...
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 import ( "time" ) func parseDialNetwork(net string) (afnet string, proto int, err error) { i := last(net, ':') if i < 0 { // no colon switch...
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 // Sockets for BSD variants package net import ( "runtime" "syscall" ) func maxListenerBacklog() int { var ( 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. // +build darwin freebsd linux netbsd openbsd package net import ( "errors" "sync" ) var ( protocols map[string]int onceReadProtocols sync.Once ...
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 NetBSD package net // If the ifindex is zero, interfaceMulticastAddrTable returns // addresses for all network interf...
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 ( "syscall" "time" ) // IPConn is the implementation of the Conn and PacketConn // interfaces for ...
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 // Unix domain sockets package net import ( "os" "syscall" "time" ) func unixSocket(net string, la...
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 netbsd openbsd // Network interface identification for BSD variants package net import ( "os" "syscall" "unsafe" ) // If the if...
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 netbsd openbsd package net import "io" func sendFile(c *netFD, r io.Reader) (n int64, err error, handled bool) { return 0, nil, fa...
Go