Your question is not clear what is being reversed, when you compare. Typically, when switching endianness, you reverse the bytes, but that is not what you seem to want here.
In any case, here is code to reverse in many different ways, using the IPAddress Go library. Disclaimer: I am the project manager.
str := "00000000ff00ff00000900000600020a"
ipAddr := ipaddr.NewIPAddressString(str).GetAddress()
reversedAddr, _ := ipAddr.ReverseBytes()
reverseEachSegment := ipAddr.ReverseSegments()
reverseBitsEachByte, _ := ipAddr.ReverseBits(true)
reverseBits, _ := ipAddr.ReverseBits(false)
fmt.Println("original", ipAddr)
fmt.Println("bytes reversed", reversedAddr)
fmt.Println("bytes reversed in each segment", reverseEachSegment)
fmt.Println("bits reversed in each byte", reverseBitsEachByte)
fmt.Println("bits reversed", reverseBits)
Output:
original ::ff00:ff00:9:0:600:20a
bytes reversed a02:6:0:900:ff:ff::
bytes reversed in each segment 20a:600:0:9:ff00:ff00::
bits reversed in each byte ::ff00:ff00:90:0:6000:4050
bits reversed 5040:60:0:9000:ff:ff::
For some reason it is reversing the bytes in each segment that gets you what you expect, although that is not switching endianness.