#Local module dependencies

1 messages · Page 1 of 1 (latest)

plush falcon
short reef
#

@plush falcon any chance you can share a minimal repro?

plush falcon
#

I try

#

@short reef wait a second, maybe I spotted the problem...

#

The function was changed from func Clone()
into func Clone(commitSha string)

I was expecting the imported function to be changed to "string" arg, indeed it becomes

type GitclonerCloneOpts struct {
    CommitSha string 
}

func (r *Gitcloner) Clone(opts ...GitclonerCloneOpts) *Directory { 
...
}
#

So in module importing the function is not using a string but a custom struct, to reflect the optional arguments too

plush falcon
#

Nice, I hope this can be a reference for other newbies

short reef
plush falcon
#

yes exactly

short reef
#

yep, that makes sense

#

if you make it required, then it becomes its own unique argument

plush falcon
#

I see. But it is not only more elegant, even more readable. As long as you get that