Move prototype 69-dagger-archon to top-level

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes
2020-12-29 18:45:16 -08:00
commit 30f75da114
42 changed files with 3955 additions and 0 deletions

43
main.go Normal file
View File

@@ -0,0 +1,43 @@
// A simple main.go for testing the dagger Go API
package main
import (
"context"
"fmt"
"os"
"dagger.cloud/go/dagger"
)
func main() {
ctx := context.TODO()
c, err := dagger.NewClient(ctx, "")
if err != nil {
fatal(err)
}
configPath := "."
if len(os.Args) > 1 {
configPath = os.Args[1]
}
if err := c.SetConfig(configPath); err != nil {
fatal(err)
}
// if err := c.ConnectInput("source", os.Getenv("HOME")+"/Documents/github/samalba/hello-go"); err != nil {
// fatal(err)
// }
if err := c.Run(ctx, "compute"); err != nil {
fatal(err)
}
}
func fatalf(msg string, args ...interface{}) {
fmt.Fprintf(os.Stderr, msg, args...)
os.Exit(1)
}
func fatal(msg interface{}) {
fatalf("%s\n", msg)
}