I am writting a dagger function in go that returns a *File that retrieves a JSON file from a rest API and then calls json.Indent to make it easier to read. The function then writes the file to the dagger container/cache using os.OpenFile and Write. I then call the following line which causes the function to fail:
daggerFile := dag.Container().
File(scanResultsFile)
When I run the function with dagger call function-name I get the following error:
marshal: json: error calling MarshalJSON for type *dagger.File: input: container.file resolve: empty reference. How do I get it to not marshal the data? My plan is to chain it to export or potentially content.
If I am misunderstanding how to perform these types of actions please le tme know a better way.