Fix the error by moving shared types or functions into a separate package that both original packages can import without importing each other. Create a new file shared/types.go containing the common code, then update package A and package B to import your/module/shared instead of each other.
// shared/types.go
package shared
type Node struct {
Circular bool
}
// package A
package a
import "your/module/shared"
func UseNode() shared.Node { return shared.Node{} }
// package B
package b
import "your/module/shared"
func CheckNode(n shared.Node) bool { return n.Circular }