go-oss is a static assets library for veeka-oss-mirror repository. It contains constant url for assets in that repository, and is self-updating via Github Actions when the repository updates.
To get the latest version use:
go get github.com/olachat/go-oss@latest
If you have added assets, you can simply update the library in your project via go get as above.
If you encounter errors due to unable to download repository (go-oss is a private repository), can
package main
import (
"fmt"
oss "github.com/olachat/go-oss/assets/static/veeka/game/bomb"
)
func main() {
fmt.Println("mosaic url is:", oss.Mosaic)
}
You might need to add private repository into your go get paths. Can try the following:
- Check that you have
github.com/olachat
in your go environment variables (GOPRIVATE,GONOPROXY,GONOSUMDB).- run
go env
and verify that the variables containsgithub.com/olachat
- if not, add them by running
go env -w GOPRIVATE=github.com/olachat
, then check again
- run
- If you are using ssh authentication, check your .gitconfig reroutes github.com to use ssh
- open
~/.gitconfig
and verify that you have:[url "[email protected]:"] insteadOf = https://github.com/
- if not, add them using vim or nano
- open
Check the following:
- After veeka-oss-mirror repository is updated on main branch, it can take awhile before library is updated. To check status, you can check that the actions have recently ran: go-oss/actions
- Your import might have conflicting path, as library maps the asset into respective directory. Double check your import path to point to your assets directory.
- You might require different package name if you are importing assets from different directories.
- For example, if you require
static/veeka/idRobotIcon
andstatic/veeka/thRobotIcon
- you need to import them separately and give a different package name:
import ( idRobotIcon "github.com/olachat/go-oss/assets/static/veeka/idRobotIcon" thRobotIcon "github.com/olachat/go-oss/assets/static/veeka/thRobotIcon" )
- For example, if you require
- If you have named your assets starting with non-alphabet characters, the library might add a
K
prefix