tasks/go.py
def vet(ctx, targets, rtloader_root=None, build_tags=None, arch="x64"):
    """
    Run go vet on targets.

    Example invokation:
        inv vet --targets=./pkg/collector/check,./pkg/aggregator
    """
    if isinstance(targets, str):
        # when this function is called from the command line, targets are passed
        # as comma separated tokens in a string
        targets = targets.split(',')

    # add the /... suffix to the targets
    args = [f"{t}/..." for t in targets]
    tags = build_tags or get_default_build_tags(build="test", arch=arch)
    tags.append("dovet")

    _, _, env = get_build_flags(ctx, rtloader_root=rtloader_root)
    env["CGO_ENABLED"] = "1"

    ctx.run(f"go vet -tags \"{' '.join(tags)}\" " + " ".join(args), env=env)
    # go vet exits with status 1 when it finds an issue, if we're here
    # everything went smooth
    print("go vet found no issues")

    Run go vet on targets.

    Example invokation:
        inv vet --targets=./pkg/collector/check,./pkg/aggregator
    
Run go vet on targets.
Run go vet on targets .
def vet(ctx, targets, rtloader_root=None, build_tags=None, arch="x64"):
    if isinstance(targets, str):
        targets = targets.split(',')
    args = [f"{t}/..." for t in targets]
    tags = build_tags or get_default_build_tags(build="test", arch=arch)
    tags.append("dovet")
    _, _, env = get_build_flags(ctx, rtloader_root=rtloader_root)
    env["CGO_ENABLED"] = "1"
    ctx.run(f"go vet -tags \"{' '.join(tags)}\" " + " ".join(args), env=env)
    print("go vet found no issues")
def vet ( ctx , targets , rtloader_root = None , build_tags = None , arch = "x64" ) : if isinstance ( targets , str ) : targets = targets . split ( ',' ) args = [ f"{t}/..." for t in targets ] tags = build_tags or get_default_build_tags ( build = "test" , arch = arch ) tags . append ( "dovet" ) _ , _ , env = get_build_flags ( ctx , rtloader_root = rtloader_root ) env [ "CGO_ENABLED" ] = "1" ctx . run ( f"go vet -tags \"{' '.join(tags)}\" " + " " . join ( args ) , env = env ) print ( "go vet found no issues" )
Run go vet on targets.
Run go vet on targets .
"""
    Run go vet on targets.

    Example invokation:
        inv vet --targets=./pkg/collector/check,./pkg/aggregator
    """ # when this function is called from the command line, targets are passed # as comma separated tokens in a string # add the /... suffix to the targets # go vet exits with status 1 when it finds an issue, if we're here # everything went smooth
ctx
targets
rtloader_root
build_tags
arch