Two parties derive the same shared secret
curve := ecdh.X25519()
aliceKey, _ := curve.GenerateKey(rand.Reader)
bobKey, _ := curve.GenerateKey(rand.Reader)
aliceShared, _ := aliceKey.ECDH(bobKey.PublicKey())
bobShared, _ := bobKey.ECDH(aliceKey.PublicKey())
// aliceShared == bobShared — feed to HKDF to derive session keys