Minor cleanups.

This commit is contained in:
Juliusz Chroboczek
2022-04-23 18:22:28 +02:00
parent 9ab84741d9
commit fc9f28fd68
8 changed files with 8 additions and 19 deletions
+2 -3
View File
@@ -1,7 +1,6 @@
package ice
import (
"bytes"
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
@@ -57,11 +56,11 @@ func TestHMAC(t *testing.T) {
mac := hmac.New(sha1.New, []byte(s.Credential.(string)))
mac.Write([]byte(sss.Username))
buf := bytes.Buffer{}
buf := strings.Builder{}
e := base64.NewEncoder(base64.StdEncoding, &buf)
e.Write(mac.Sum(nil))
e.Close()
ss.Credential = string(buf.Bytes())
ss.Credential = buf.String()
if err != nil || !reflect.DeepEqual(sss, ss) {
t.Errorf("Got %v, expected %v", sss, ss)