update typesetting usage


Assigned to
6 months ago
3 months ago
No labels applied.

~sewn 6 months ago

Oops, i accidentally submitted too early.

Running go get -u ./... in my program that utilizes causes these errors when building:

# gioui.org/text
../../.cache/go/mod/gioui.org@v0.4.1/text/gotext.go:279:35: not enough arguments in call to s.fontMap.AddFace
        have (*"github.com/go-text/typesetting/opentype/api/font".Face, metadata.Description)
        want (*"github.com/go-text/typesetting/opentype/api/font".Face, api.FontID, metadata.Description)

~whereswaldon REPORTED INVALID 6 months ago

go get -u ./...

Is a fundamentally unsafe operation if you have even one dependency that doesn't use tagged releases. It will happily upgrade you to incompatible dependencies. Please avoid doing that. I know that it seems convenient, but it breaks programs all the time.

Zhiwei Song 4 months ago ยท edit

But, how to resolve it when this happens?

~egonelbre 4 months ago

Without seeing go.mod it's difficult to say anything specific, but usually, removing dependency the lines from go.mod (i.e. everything except module and go version declaration) and running go mod tidy makes things work again. Alternatively, revert to an earlier working go.mod and then only update gio with go get gioui.org@latest

~gedw99 3 months ago

https://github.com/oligot/go-mod-upgrade allows to selectively upgrade a go projects dependencies.

It works well and I think it might help your use case. I have used it with GIO projects just fine.

give it a try, and I hope this helps you..

Register here or Log in to comment, or comment via email.