1// Copyright 2019 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build go1.12
6
7package acme
8
9import "runtime/debug"
10
11func init() {
12	// Set packageVersion if the binary was built in modules mode and x/crypto
13	// was not replaced with a different module.
14	info, ok := debug.ReadBuildInfo()
15	if !ok {
16		return
17	}
18	for _, m := range info.Deps {
19		if m.Path != "golang.org/x/crypto" {
20			continue
21		}
22		if m.Replace == nil {
23			packageVersion = m.Version
24		}
25		break
26	}
27}
28