Getting error building environment-to-ini.go command #6843

Closed
opened 2025-11-02 07:08:19 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @abhishekvaidprophecy on GitHub (Feb 10, 2021).

Description

  • I'm trying to build the command from environment-to-ini.go.
  • I copied the code in this file on latest branch to a local Go file in a temporary go module and ran

go get
go build <filename>

  • I got this error:
(base) ➜  gitea-to-ini go build giteaEnvToIni.go
# command-line-arguments
./giteaEnvToIni.go:100:17: undefined: util.IsFile
  • My OS: macOs Big Sur 11.1
  • My GoLang Version:
(base) ➜  gitea-to-ini go version
go version go1.15.5 darwin/amd64

Screenshots

Screenshot 2021-02-11 at 2 01 57 AM
Originally created by @abhishekvaidprophecy on GitHub (Feb 10, 2021). ## Description - I'm trying to build the command from `environment-to-ini.go`. - I copied the code in this file on latest branch to a local Go file in a temporary go module and ran `go get` `go build <filename>` - I got this error: ``` (base) ➜ gitea-to-ini go build giteaEnvToIni.go # command-line-arguments ./giteaEnvToIni.go:100:17: undefined: util.IsFile ``` - My OS: macOs Big Sur 11.1 - My GoLang Version: ``` (base) ➜ gitea-to-ini go version go version go1.15.5 darwin/amd64 ``` ## Screenshots <img width="961" alt="Screenshot 2021-02-11 at 2 01 57 AM" src="https://user-images.githubusercontent.com/75244584/107568532-21a88900-6c0d-11eb-9cb4-86a34be24a29.png">
GiteaMirror added the type/question label 2025-11-02 07:08:19 -06:00
Author
Owner

@jolheiser commented on GitHub (Feb 10, 2021):

That's because that "script" depends on code from the main repo, in the util package.

If you are running it without a go.mod, Go is using your GOPATH which may have an outdated version of Gitea if you've built it before.

@jolheiser commented on GitHub (Feb 10, 2021): That's because that "script" depends on code from the main repo, in the [util package](https://github.com/go-gitea/gitea/blob/4cffc46f651205b9d7eb0b1df46dd6117c6d95e9/modules/util/path.go#L53). If you are running it without a `go.mod`, Go is using your `GOPATH` which may have an outdated version of Gitea if you've built it before.
Author
Owner

@abhishekvaidprophecy commented on GitHub (Feb 10, 2021):

Thanks for such a quick response. I thought the git imports will be remotely fetched.
So, can you please suggest a preferred way to build this command.

@abhishekvaidprophecy commented on GitHub (Feb 10, 2021): Thanks for such a quick response. I thought the git imports will be remotely fetched. So, can you please suggest a preferred way to build this command.
Author
Owner

@jolheiser commented on GitHub (Feb 10, 2021):

Get a fresh copy of the main repo, and then build the file where it sits in the main repo (as opposed to copying it elsewhere).

@jolheiser commented on GitHub (Feb 10, 2021): Get a fresh copy of the main repo, and then build the file where it sits in the main repo (as opposed to copying it elsewhere).
Author
Owner

@jolheiser commented on GitHub (Feb 10, 2021):

I'm going to close this issue, feel free to stop by the Discord if you have further questions. 🙂

@jolheiser commented on GitHub (Feb 10, 2021): I'm going to close this issue, feel free to stop by the [Discord](https://discord.gg/gitea) if you have further questions. 🙂
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6843