cespare/xxhash

incompatibility with Golang v1.9

mdaliyan opened this issue · 2 comments

I faced this error after updating golang from 1.8 to 1.9. I have deleted all installed packages just in case but this error still exists.

package math/bits: unrecognized import path "math/bits" (import path does not begin with hostname)

file: github.com/cespare/xxhash/rotate19.go

// +build go1.9

package xxhash

import "math/bits"

func rol1(x uint64) uint64  { return bits.RotateLeft64(x, 1) }
func rol7(x uint64) uint64  { return bits.RotateLeft64(x, 7) }
func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }
func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }
func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }
func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }
func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }
func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }

Any suggestions?

Go 1.9 added the math/bits package. See https://golang.org/doc/go1.9#math-bits. Is your Go installation broken somehow?

I reinstalled everything from scratch and the problem is fixed now.
Sorry to bring it on without checking my installation.
Thanks