godo icon indicating copy to clipboard operation
godo copied to clipboard

Expect Gododir to be a valid go package (not command).

Open GeertJohan opened this issue 11 years ago • 4 comments

GeertJohan avatar Dec 03 '14 14:12 GeertJohan

This implements the changes as described in #11 Existing usage of Gododir/Godofile.go should not break, unless Gododir/Godofile.go is a package main, in which case the user get's an error. Fixing is trivial (rename package, remove func main()).

GeertJohan avatar Dec 03 '14 14:12 GeertJohan

I apologize for not looking at this yet. I had a loong holiday. Will try to get to it this weekend.

mgutz avatar Jan 07 '15 16:01 mgutz

Sure no problem!

GeertJohan avatar Jan 07 '15 22:01 GeertJohan

Unfortunately godo does not work in directories outside of GOPATH with this PR. I get import cycle not allowed errors. If I remember correctly that's why I settled on package main.

I created this file in my tmp/Gododir/main.go

package tasks

import (
    . "gopkg.in/godo.v1"
)

func Tasks(p *Project) {
    p.Task("whoami", func() {
        Run("whoami")
    })
}

It works well inside of GOPATH.

mgutz avatar Jan 22 '15 03:01 mgutz