Skip to content

Improve error reporting on mg.Deps() usage errors #332

@flowchartsman

Description

@flowchartsman

Given the following magefile:

// +build mage

package main

import (
        "github.com/magefile/mage/mg"
        "github.com/magefile/mage/sh"
)

func Echo() error {
        return sh.RunV("echo", "hello")
}

func EchoDep() error {
        mg.Deps(mg.F(Echo()))
        return nil
}
$ mage echo
hello

$ mage echoDep
hello
Error: runtime error: invalid memory address or nil pointer dereference

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions