Last active
May 5, 2017 16:40
-
-
Save sdboyer/b0bce464498af3c2cb6e5a4371bfe909 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"github.com/golang/dep/gps" | |
) | |
func main() { | |
td, err := ioutil.TempDir("", "testdep") | |
if err != nil { | |
panic(err) | |
} | |
defer os.RemoveAll(td) | |
sm, err := gps.NewSourceManager(td) | |
if err != nil { | |
panic(err) | |
} | |
defer sm.Release() | |
id := gps.ProjectIdentifier{ | |
ProjectRoot: gps.ProjectRoot("source.mycompany.com/core/thing.git"), | |
Source: "ssh://source.mycompany.com:7999/core/thing", | |
} | |
lv, err := sm.ListVersions(id) | |
if err != nil { | |
fmt.Println("err from ListVersions:", err) | |
} else { | |
fmt.Printf("%#v\n", lv) | |
} | |
err = sm.SyncSourceFor(id) | |
if err != nil { | |
fmt.Println("err from SyncSourceFor:", err) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment