...

Source file src/golang.org/x/crypto/acme/version_go112.go

Documentation: golang.org/x/crypto/acme

     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  //go:build go1.12
     6  
     7  package acme
     8  
     9  import "runtime/debug"
    10  
    11  func 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  

View as plain text