ipv6: move unexposed error values into helper.go

Change-Id: Iac5121529bb1044e64724937f5d5e2bff8a336a6
Reviewed-on: https://go-review.googlesource.com/16321
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Mikio Hara
2015-10-26 12:18:18 +09:00
parent cf6265fb6d
commit 4f2fc6c1e6
3 changed files with 8 additions and 10 deletions

View File

@@ -5,18 +5,11 @@
package ipv6
import (
"errors"
"fmt"
"net"
"sync"
)
var (
errMissingAddress = errors.New("missing address")
errInvalidConnType = errors.New("invalid conn type")
errNoSuchInterface = errors.New("no such interface")
)
// Note that RFC 3542 obsoletes RFC 2292 but OS X Snow Leopard and the
// former still support RFC 2292 only. Please be aware that almost
// all protocol implementations prohibit using a combination of RFC

View File

@@ -5,7 +5,6 @@
package ipv6
import (
"errors"
"fmt"
"net"
)
@@ -37,7 +36,7 @@ func (h *Header) String() string {
// ParseHeader parses b as an IPv6 base header.
func ParseHeader(b []byte) (*Header, error) {
if len(b) < HeaderLen {
return nil, errors.New("header too short")
return nil, errHeaderTooShort
}
h := &Header{
Version: int(b[0]) >> 4,

View File

@@ -9,7 +9,13 @@ import (
"net"
)
var errOpNoSupport = errors.New("operation not supported")
var (
errMissingAddress = errors.New("missing address")
errHeaderTooShort = errors.New("header too short")
errInvalidConnType = errors.New("invalid conn type")
errOpNoSupport = errors.New("operation not supported")
errNoSuchInterface = errors.New("no such interface")
)
func boolint(b bool) int {
if b {