Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove relative path #2

Open
rizahmeds opened this issue Feb 29, 2024 · 2 comments
Open

Remove relative path #2

rizahmeds opened this issue Feb 29, 2024 · 2 comments

Comments

@rizahmeds
Copy link

data, err := budget_db.Table("../../db/budget_db/migrations/001_create_budget_table.sql", 0)

No need to mention the relative path here in the above code because that has been already mentioned inside the function definition:

query, err := os.ReadFile("db/budget_db/migrations/" + filename)

Advise is to remove from flow/internal/app/budget/budget.go file and find an appropriate way to put the relative paths of the file.

@ibilalkayy
Copy link
Owner

data, err := budget_db.Table("../../db/budget_db/migrations/001_create_budget_table.sql", 0)

This path is mentioned one time in the function.

query, err := os.ReadFile("db/budget_db/migrations/" + filename)

Can you give me ideas about putting it somewhere else.

@rizahmeds
Copy link
Author

rizahmeds commented Feb 29, 2024

I mentioned the advice/idea in the previous comment 🙂

Let it be in connection.go and remove the path from budget.go file. Only pass the migration file from there.

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

No branches or pull requests

2 participants