Re: [go-nuts] Re: go:embed question
What makes you think that go run github.com/esimov/caire/cmd/caire@latest is not embedding properly? On my system it seems like it works fine, and the file gets embedded. I'm using go 1.19 on windows. Perhaps you could give a more detailed example of what you are doing (actual commands) and what you see, and what you actually expect to see. If you do that in a way that allows other to replicate you problem, you might get a useful response. On Saturday, October 15, 2022 at 11:49:11 PM UTC-4 esi...@gmail.com wrote: > go run github.com/esimov/caire/cmd/caire@latest. > > I'm wondering is this somehow related to the fact, that the file which > should be embedded is located two levels up to the root tree? The embedable > file is located in the data folder, but the file effectively is not > embedded in cmd/caire/main.go, but in a file called process.go which is at > the same level as the data folder. > > ├───cmd > │ └───caire/main.go > ├───data > > On Friday, October 14, 2022 at 11:50:18 AM UTC+3 kortschak wrote: > >> On Fri, 2022-10-14 at 00:17 -0700, esimov wrote: >> > . 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 >> >> Can you give an example of a real package where this doesn't work? >> >> -- 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/9108880d-bbd1-4bf0-92e9-a626b70f437dn%40googlegroups.com.
Re: [go-nuts] Re: go:embed question
go run github.com/esimov/caire/cmd/caire@latest. I'm wondering is this somehow related to the fact, that the file which should be embedded is located two levels up to the root tree? The embedable file is located in the data folder, but the file effectively is not embedded in cmd/caire/main.go, but in a file called process.go which is at the same level as the data folder. ├───cmd │ └───caire/main.go ├───data On Friday, October 14, 2022 at 11:50:18 AM UTC+3 kortschak wrote: > On Fri, 2022-10-14 at 00:17 -0700, esimov wrote: > > . 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 > > Can you give an example of a real package where this doesn't work? > > -- 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/6923b939-ec92-4d87-9b38-e449bf5e6ecdn%40googlegroups.com.
Re: [go-nuts] Re: go:embed question
It won't work iff that file is not there - e.g. it is not commited into the repo. kortschak a következőt írta (2022. október 14., péntek, 10:50:18 UTC+2): > On Fri, 2022-10-14 at 00:17 -0700, esimov wrote: > > . 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 > > Can you give an example of a real package where this doesn't work? > > -- 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/4e3a43d4-603c-458d-844e-fa156dc76042n%40googlegroups.com.
Re: [go-nuts] Re: go:embed question
On Fri, 2022-10-14 at 00:17 -0700, esimov wrote: > . 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 Can you give an example of a real package where this doesn't work? -- 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/2af5f60f43a9c2f169ab5d888f20ac96d18ea826.camel%40kortschak.io.
[go-nuts] Re: go:embed question
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.
[go-nuts] Re: go:embed question
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/760b8eb4-2644-4be0-a4f8-fb1288e3492en%40googlegroups.com.