#can you have multiple entry points per module in the go sdk

1 messages · Page 1 of 1 (latest)

tender jolt
#

Hi folks.

Trying to have some debug functions in my module without using my costum entry proint which requires many arguments

here is my entry point now. i want one that takes no argument.

func New(
    gitBranch string,
    gitMsg string,
    gitSha string,
    gitSource string,

    githubToken *dagger.Secret,

    // +optional
    relTag string,

    // +optional
    gitRepo string,

) *PfTools {
    return &PfTools{
        Gitbr: gitBranch,

        Gitmsg:    gitMsg,
        Gitsha:    gitSha,
        Gitsource: gitSource,

        RelTag:      relTag,
        GithubToken: githubToken,
    }
}

Regards

timid meadow
#

What happens if you make them all optional? That seems like the easiest way

tender jolt
#

i was not sure if it was allowed to have multiple entry points or no. the docs are not very clear about that . if its not possible then i have to like you proposed find a workaround

timid meadow
#

No there can only be one entrypoint. It's like the constructor function for the module's main type