Let me rephrase it: so normally when you are embedding an external file 
with the go://embed directive, when you are running the "go run" command it 
will embed it at compile time. Now, that's not the case when you are 
running a package using the following command: "go run 
github.com/user/package@latest" for example. Hope that's clear now.

On Thursday, October 13, 2022 at 8:22:26 PM UTC+3 Marcel Huijkman wrote:

> I find this question a bit hard to understand. I think it has to do with 
> go run and then a URL, which can't be done.
> Can you rephrase it?
>
> On Wednesday, October 12, 2022 at 9:37:17 AM UTC+2 esi...@gmail.com wrote:
>
>> I know that //go:embed directive reads the content of the embedable file 
>> at compile time. Now if that's the case I wondering if you are running a Go 
>> executable with "go run" at the same time while you are downloading like go 
>> run github.com/user/projectname@latest (which should embed an external 
>> file) why the file is not embedded?
>>
>> Normally if the file you want to embed does not exits, the compiler will 
>> throw you an error telling that "no matching files found". Why is not the 
>> case when you are running without a prior download? 
>>
>> I'm asking this because if I'm running the application normally the file 
>> is getting embedded correctly, but if I'm trying to build it on-the-fly 
>> with go run this is not happening? 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/21d532ad-af6d-4276-b68e-3c98fc17d0b0n%40googlegroups.com.

Reply via email to