glycerine / zygomys

Zygo is a Lisp interpreter written in 100% Go. Central use case: dynamically compose Go struct trees in a zygo script, then invoke compiled Go functions on those trees. Makes Go reflection easy.
https://github.com/glycerine/zygomys/wiki
BSD 2-Clause "Simplified" License
1.71k stars 81 forks source link

fix go.mod version to v6 according workflow https://go.dev/doc/module… #58

Closed maxxant closed 1 year ago

maxxant commented 1 year ago

this PR fixes the following issues:

1) the docs https://pkg.go.dev/github.com/glycerine/zygomys have latest tag v5.1.2+incompatible but repository contains v6.0.3

2) go get github.com/glycerine/zygomys@v6.0.3 does not work, because

https://proxy.golang.org/github.com/glycerine/zygomys/@v/v6.0.3.info returns:

not found: github.com/glycerine/zygomys@v6.0.3: invalid version: module contains a go.mod file, so module path must match major version ("github.com/glycerine/zygomys/v6")

Additional info https://go.dev/ref/mod#incompatible-versions

UP: https://go.dev/ref/mod#minimal-module-compatibility

minimal module compatibility was added in Go 1.11 and was backported to Go 1.9.7 and 1.10.3. When an import path is resolved to a directory in GOPATH mode

this means that the Golang minimum compatible version cannot be lower than 1.9.7 after PR applied

glycerine commented 1 year ago

Thank you.

maxxant commented 1 year ago

thanks, if it doesn't make it difficult, you can mark a new tag v6.0.4 because there is no correct mod file for the old tags. After creating a new tag and requesting https://pkg.go.dev/github.com/glycerine/zygomys@v6.0.4 the documentation will be updated and modules versioning will work well from the new version

glycerine commented 1 year ago

Ok. I've tagged the latest as v6.0.4

glycerine commented 1 year ago

@maxxant feel free to make other suggestions or PR to help get modules working with zygo. I don't use modules much myself, so I'm pretty clueless about how to get them working.

glycerine commented 1 year ago

for instance, I tried to check that the latest go get would work, but got

 ~/go/src/github.com/glycerine/zygomys (master) $ go get github.com/glycerine/zygomys@v6.0.4
go get: github.com/glycerine/zygomys@v6.0.4: invalid version: module contains a go.mod file, so major version must be compatible: should be v0 or v1, not v6
~/go/src/github.com/glycerine/zygomys (master) $

If you know how to remedy/fix that, please advise. I have no idea.

maxxant commented 1 year ago

for instance, I tried to check that the latest go get would work, but got ...

please try it:

go get github.com/glycerine/zygomys/v6

or

go get github.com/glycerine/zygomys/v6@v6.0.4

so updated docs with /v6 too https://pkg.go.dev/github.com/glycerine/zygomys/v6

maxxant commented 1 year ago

in my opinion, versioning in the language is about api stability, which is not always convenient. For experimental projects, it's fine to have v0 and break compatibility in minor updates, it doesn't require /v6 or anything like that.

I am not a module specialist either, but in the current state of the code, I could not immediately understand why my go get installation is not the latest version (only 5.1.2) and there is no latest documentation on pkg.go.dev. Now it's fixed

Perhaps in the readme.md it is worth adding a link to the documentation

[![Go Reference](https://pkg.go.dev/badge/github.com/glycerine/zygomys.svg)](https://pkg.go.dev/github.com/glycerine/zygomys/v6/zygo)

visible as : Go Reference

and command to download

go get github.com/glycerine/zygomys/v6

or when modules are disabled (GO111MODULE=off):

go get github.com/glycerine/zygomys/zygo