#! main object not found

1 messages · Page 1 of 1 (latest)

grim elbow
#

Ok - sorry to bother again, but kind of lost. I am working on a new module for a demo at the office for dagger. This is a super simple setup. But I'm still new to dagger and golang.

Steps.

  1. Create Folder on drive (demo)
  2. dagger init --sdk=go (while in the directory created above) (all on Windows as an FYI)
  3. edit demo/dagger/main.go to have the following code (from dagger.io docs):

package main

type MyModule struct{}

func (m *MyModule) Hello() string {
return "Hello, world"
}

  1. run dagger call hello (or Hello) in case of case issue - and I get this: ! main object not found

What am I doing wrong?

dagger v0.11.7 (registry.dagger.io/engine) windows/amd64

hushed chasm
#

I run into this all the time when copying things.

Make sure that the name of your module MyModule in main.go is the same as the name of your module in dagger.json

grim elbow
#

@hushed chasm - thanks for the advice - I made sure it was all the same per your post, but no dice. I'll poke around some more. Thanks again for the help!