Skip to content

Commit 73f6362

Browse files
cpugopherbot
authored andcommitted
acme: remove dead code
The private encodePem() and unique() functions under the acme package had no call-sites and so can be removed. Change-Id: Ic617392e7cc9b9e795456626a623ba02df108694 Reviewed-on: https://go-review.googlesource.com/c/crypto/+/676875 LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Roland Shoemaker <[email protected]> Auto-Submit: Daniel McCarney <[email protected]> Reviewed-by: Michael Knyszek <[email protected]>
1 parent ebc8e46 commit 73f6362

File tree

2 files changed

+0
-19
lines changed

2 files changed

+0
-19
lines changed

acme/acme.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"encoding/base64"
3434
"encoding/hex"
3535
"encoding/json"
36-
"encoding/pem"
3736
"errors"
3837
"fmt"
3938
"math/big"
@@ -816,11 +815,5 @@ func tlsChallengeCert(san []string, opt []CertOption) (tls.Certificate, error) {
816815
}, nil
817816
}
818817

819-
// encodePEM returns b encoded as PEM with block of type typ.
820-
func encodePEM(typ string, b []byte) []byte {
821-
pb := &pem.Block{Type: typ, Bytes: b}
822-
return pem.EncodeToMemory(pb)
823-
}
824-
825818
// timeNow is time.Now, except in tests which can mess with it.
826819
var timeNow = time.Now

acme/autocert/internal/acmetest/ca.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -782,15 +782,3 @@ func decodePayload(v interface{}, r io.Reader) error {
782782
func challengeToken(domain, challType string, authzID int) string {
783783
return fmt.Sprintf("token-%s-%s-%d", domain, challType, authzID)
784784
}
785-
786-
func unique(a []string) []string {
787-
seen := make(map[string]bool)
788-
var res []string
789-
for _, s := range a {
790-
if s != "" && !seen[s] {
791-
seen[s] = true
792-
res = append(res, s)
793-
}
794-
}
795-
return res
796-
}

0 commit comments

Comments
 (0)