pelletier / go-toml

Go library for the TOML file format
https://github.com/pelletier/go-toml
Other
1.7k stars 209 forks source link

Default branch should be master #784

Closed fubaydullaev closed 2 years ago

fubaydullaev commented 2 years ago

Can you please make the master default branch ? Some modules, projects doesn't work as it sees v2 as default branch and it has some missing peace of code

` if ext == ".toml" { tree, err := toml.LoadReader(bytes.NewReader(buf)) if err != nil { return nil, err }

    m := make(map[string]map[string]interface{})
    for k, v := range tree.ToMap() {
        m[k] = v.(map[string]interface{})
    }

    return parseFlatFormat(m)

} `

pelletier commented 2 years ago

Which version of go are you using? and could you update to go-toml v2? I'm very hesitant about changing the default branch because it would be more confusing for the majority of people who really want go-toml v2, and it breaks multiple github feautres.

fubaydullaev commented 2 years ago

1.18, for me it's easy to update to v2 without any problems. But I'm using the project of others readium/readium-lcp-server which uses other plugin github.com/nicksnyder/go-i18n and that one uses go-toml v1, and this is actually dependency problem

On Sat, May 28, 2022 at 10:14 PM Thomas Pelletier @.***> wrote:

Which version of go are you using? and could you update to go-toml v2? I'm very hesitant about changing the default branch because it would be more confusing for the majority of people who really want go-toml v2, and it breaks multiple github feautres.

— Reply to this email directly, view it on GitHub https://github.com/pelletier/go-toml/issues/784#issuecomment-1140299762, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQ6OWPXYXBHTUUCZ3XPPNTVMJH7NANCNFSM5XGHRWTA . You are receiving this because you authored the thread.Message ID: @.***>

-- Kind regards, Furkat Ubaydullaev

pelletier commented 2 years ago

Can you provide a reproduction of the issue? I don't run into it locally.

Running go get github.com/pelletier/go-toml seems to resolve to the right tag:

docker run -ti --rm golang:1.18.2 /bin/bash -c "mkdir /m; cd /m; go mod init example.com/m; go get github.com/pelletier/go-toml"
go: creating new go.mod: module example.com/m
go: downloading github.com/pelletier/go-toml v1.9.5
go: added github.com/pelletier/go-toml v1.9.5

Same with the readium-lcp-server library you mention:

$ docker run -ti --rm golang:1.18.2
root@ed22002bef0d:/go# mkdir /m; cd /m
root@ed22002bef0d:/m# go mod init example.com/m
go: creating new go.mod: module example.com/m
root@ed22002bef0d:/m# cat > main.go <<EOF
package main

import "github.com/readium/readium-lcp-server/localization"

func main() {
localization.InitTranslations()
}
EOF
root@ed22002bef0d:/m# go get github.com/readium/readium-lcp-server/localization
go: downloading github.com/readium/readium-lcp-server v0.0.0-20220202182453-bff371c5bde3
go: downloading github.com/nicksnyder/go-i18n v1.10.1
go: downloading gopkg.in/yaml.v2 v2.2.8
go: downloading github.com/pelletier/go-toml v1.2.0
go: added github.com/nicksnyder/go-i18n v1.10.1
go: added github.com/pelletier/go-toml v1.2.0
go: added github.com/readium/readium-lcp-server v0.0.0-20220202182453-bff371c5bde3
go: added gopkg.in/yaml.v2 v2.2.8
root@ed22002bef0d:/m# go run main.go
root@ed22002bef0d:/m#
pelletier commented 2 years ago

Closing as there has been no activity and I don't believe the report describe a valid issue.