cespare / xxhash

A Go implementation of the 64-bit xxHash algorithm (XXH64)
MIT License
1.79k stars 123 forks source link

incompatibility with Golang v1.9 #11

Closed mdaliyan closed 6 years ago

mdaliyan commented 6 years ago

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?

dmitshur commented 6 years ago

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

mdaliyan commented 6 years ago

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