本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
566B

  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. // +build go1.12
  5. package acme
  6. import "runtime/debug"
  7. func init() {
  8. // Set packageVersion if the binary was built in modules mode and x/crypto
  9. // was not replaced with a different module.
  10. info, ok := debug.ReadBuildInfo()
  11. if !ok {
  12. return
  13. }
  14. for _, m := range info.Deps {
  15. if m.Path != "golang.org/x/crypto" {
  16. continue
  17. }
  18. if m.Replace == nil {
  19. packageVersion = m.Version
  20. }
  21. break
  22. }
  23. }
上海开阖软件有限公司 沪ICP备12045867号-1