{"action":"opened","issue":{"url":"https://api.github.com/repos/magefile/mage/issues/154","repository_url":"https://api.github.com/repos/magefile/mage","labels_url":"https://api.github.com/repos/magefile/mage/issues/154/labels{/name}","comments_url":"https://api.github.com/repos/magefile/mage/issues/154/comments","events_url":"https://api.github.com/repos/magefile/mage/issues/154/events","html_url":"https://github.com/magefile/mage/issues/154","id":358401206,"node_id":"MDU6SXNzdWUzNTg0MDEyMDY=","number":154,"title":"Namespaces and dependencies don't seem to like each other","user":{"login":"jlucktay","id":460028,"node_id":"MDQ6VXNlcjQ2MDAyOA==","avatar_url":"https://avatars1.githubusercontent.com/u/460028?v=4","gravatar_id":"","url":"https://api.github.com/users/jlucktay","html_url":"https://github.com/jlucktay","followers_url":"https://api.github.com/users/jlucktay/followers","following_url":"https://api.github.com/users/jlucktay/following{/other_user}","gists_url":"https://api.github.com/users/jlucktay/gists{/gist_id}","starred_url":"https://api.github.com/users/jlucktay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlucktay/subscriptions","organizations_url":"https://api.github.com/users/jlucktay/orgs","repos_url":"https://api.github.com/users/jlucktay/repos","events_url":"https://api.github.com/users/jlucktay/events{/privacy}","received_events_url":"https://api.github.com/users/jlucktay/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-09T18:48:30Z","updated_at":"2018-09-09T18:48:30Z","closed_at":null,"author_association":"NONE","body":"I had this in my magefile, and it was all OK:\r\n```\r\n// Deploys and tests the web app.\r\nfunc Def() {\r\n\tmg.Deps(Deploy)\r\n\tmg.Deps(TestSite, PruneOldVersions)\r\n}\r\n\r\n// Deploys the web app to Google Cloud using the SDK.\r\n// Assumes that credentials etc are already set up.\r\nfunc Deploy() error {\r\n\treturn sh.Run(\"gcloud\", \"app\", \"deploy\", fmt.Sprintf(\"--project=%s\", gcpProject), \"--quiet\", \"--verbosity=critical\", \"--promote\")\r\n}\r\n```\r\n\r\nI added a `WebApp` namespace and rounded up a few related `func`s into it, like so:\r\n```\r\ntype (\r\n\tWebApp mg.Namespace\r\n)\r\n\r\n// Deploys and tests the web app.\r\nfunc Def() {\r\n\tmg.Deps(WebApp.Deploy)\r\n\tmg.Deps(WebApp.Test, WebApp.Prune)\r\n}\r\n\r\n// Deploys the web app to Google Cloud using the SDK.\r\n// Assumes that credentials etc are already set up.\r\nfunc (WebApp) Deploy() error {\r\n\treturn sh.Run(\"gcloud\", \"app\", \"deploy\", fmt.Sprintf(\"--project=%s\", gcpProject), \"--quiet\", \"--verbosity=critical\", \"--promote\")\r\n}\r\n```\r\n\r\nAfter the change, `mage` throws this error:\r\n```\r\nError: Invalid type for dependent function: func(main.WebApp) error. Dependencies must be func(), func() error, func(context.Context) or func(context.Context) error\r\n```\r\n\r\nDoes `mg.Deps()` not allow for namespaces like this?\r\nAm I doing something wrong somewhere?\r\n"}}
{"actor":{"display_login":"jlucktay"}}