Wednesday, May 15, 2024
HomeGolangI am merely attempting to import a operate from one other file...

I am merely attempting to import a operate from one other file – Getting Assist


Sorry if this query is just too primary. I simply began studying Go yesterday

I’m attempting to import a operate from one other file however I get a console error saying the operate is undefined. Cant determine what I’m doing mistaken.

I pushed it to my github repo for simple viewing : alkapwn3d/vending-machine-go

go run vending-machine.go” will solely compile that one file. Whereas “go run .” will compile and run all the .go supply information within the listing.

go assist run

Run compiles and runs the named predominant Go bundle.
Usually the bundle is specified as an inventory of .go supply information from a single
listing, however it might even be an import path, file system path, or sample
matching a single identified bundle, as in ‘go run .’ or ‘go run my/cmd’.

Duh. I ought to have identified, however that is sensible.
Many thanks variety sir.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments