mirror of https://github.com/tailscale/tailscale/
tool/gocross: break circular dependency on tailcfg (#15829)
Instead of using the version package (which depends on tailcfg.CurrentCapabilityVersion) to get the git commit hash, do it directly using debug.BuildInfo. This way, when changing struct fields in tailcfg, we can successfully `go generate` it without compiler errors. Updates #9634 Updates https://github.com/tailscale/corp/issues/26717 Signed-off-by: Andrew Lytvynov <awly@tailscale.com>pull/15834/head
parent
cc6f367520
commit
a9b3e09a1f
@ -0,0 +1,19 @@
|
|||||||
|
// Copyright (c) Tailscale Inc & AUTHORS
|
||||||
|
// SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"tailscale.com/tstest/deptest"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestDeps(t *testing.T) {
|
||||||
|
deptest.DepChecker{
|
||||||
|
BadDeps: map[string]string{
|
||||||
|
"tailscale.com/tailcfg": "circular dependency via go generate",
|
||||||
|
"tailscale.com/version": "circular dependency via go generate",
|
||||||
|
},
|
||||||
|
}.Check(t)
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue