Blame vendor/golang.org/x/crypto/acme/version_go112.go

Packit Service 509fd4
// Copyright 2019 The Go Authors. All rights reserved.
Packit Service 509fd4
// Use of this source code is governed by a BSD-style
Packit Service 509fd4
// license that can be found in the LICENSE file.
Packit Service 509fd4
Packit Service 509fd4
// +build go1.12
Packit Service 509fd4
Packit Service 509fd4
package acme
Packit Service 509fd4
Packit Service 509fd4
import "runtime/debug"
Packit Service 509fd4
Packit Service 509fd4
func init() {
Packit Service 509fd4
	// Set packageVersion if the binary was built in modules mode and x/crypto
Packit Service 509fd4
	// was not replaced with a different module.
Packit Service 509fd4
	info, ok := debug.ReadBuildInfo()
Packit Service 509fd4
	if !ok {
Packit Service 509fd4
		return
Packit Service 509fd4
	}
Packit Service 509fd4
	for _, m := range info.Deps {
Packit Service 509fd4
		if m.Path != "golang.org/x/crypto" {
Packit Service 509fd4
			continue
Packit Service 509fd4
		}
Packit Service 509fd4
		if m.Replace == nil {
Packit Service 509fd4
			packageVersion = m.Version
Packit Service 509fd4
		}
Packit Service 509fd4
		break
Packit Service 509fd4
	}
Packit Service 509fd4
}