Help me write babys_first_ipfs_program.go

Greetings, I’m trying to learn IPFS with go but am having trouble because coding tutorials are all in JS.

What should be the contents of babys_first_ipfs_program.go for it to output the same thing as if I called

$ ipfs id

Thank you for your help

You can start here:

1 Like

Thank you kindly.
Can you assist me further?

Working from example go-ipfs-as-a-library

i) I’m trying to add a -w flag to ipfs.Unixfs().Add(ctx, someFile) but have found no appropriate option flag in

ii) I’m trying to add a -o flag to files.WriteTo(rootNodeFile, outputPathFile) but can’t even find the WriteTo function in the docs.

edit: I see now that adding -o flag to WriteTo makes no sense, since I can set an arbitrary file name in outputPathFile. I still can’t find any documentation on WriteTo though.