Skip to content
This repository has been archived by the owner on Feb 17, 2021. It is now read-only.

Include expects a constant string literal #8

Closed
davinash opened this issue Jun 26, 2020 · 3 comments
Closed

Include expects a constant string literal #8

davinash opened this issue Jun 26, 2020 · 3 comments

Comments

@davinash
Copy link

davinash commented Jun 26, 2020

I may be using the API incorrectly. binclude.Include always expects string literal.
binclude.Include(fmt.Sprintf("%s", "./out/myexe"))
Does not work and give error

[binclude] 2020/06/26 06:09:47 argument is not string literal

Is there a way to avoid this, I am looking for reading the file name from say input json

@lu4p
Copy link
Owner

lu4p commented Jun 26, 2020

This is not possible, because binclude runs before any of the code runs/ you cannot include files at runtime.

What exactly are you trying to achieve?

I could add support for let's say binclude.IncludeFromFile("files.text") which reads a text file that contains the paths to include. Would that solve the issue you are having?

@lu4p lu4p changed the title argument is not string literal Include expects a string literal Jun 26, 2020
@lu4p lu4p changed the title Include expects a string literal Include expects a constant string literal Jun 26, 2020
@davinash
Copy link
Author

Yes, That would really help. Thanks

@lu4p lu4p closed this as completed in dad4cfd Jun 26, 2020
@lu4p
Copy link
Owner

lu4p commented Jun 26, 2020

@davinash Added support for binclude.IncludeFromFile("includefiles.text")

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants