Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/text/unicode/bidi: API not implemented but code works fine #42356

Closed
pgundlach opened this issue Nov 3, 2020 · 2 comments
Closed

x/text/unicode/bidi: API not implemented but code works fine #42356

pgundlach opened this issue Nov 3, 2020 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation
Milestone

Comments

@pgundlach
Copy link
Contributor

@pgundlach pgundlach commented Nov 3, 2020

What version of Go are you using (go version)?

$ go version go1.15.3 darwin/amd64

The code in unicode/bidi is working fine (as far as I can see), but there is no user level API available, though it is documented. See https://pkg.go.dev/golang.org/x/text/unicode/bidi for example. All methods are unimplemented (panic()).

I suggest to change the API slightly to avoid panics in the library (should be errors instead) and perhaps to clarify the parameters. For example the func (*Paragraph) Line could mention if the start and end parameters are given in bytes or runes.

I am working on an implementation of the API and my question is: is it worth issuing a pull request or is the API left out on purpose?

Would it be okay to remove the panics and return errors instead?

My background is that I am using the bidi algorithm of my TeX based typesetting system and currently just pulling in the relevant files.

@gopherbot gopherbot added this to the Unreleased milestone Nov 3, 2020
@toothrot toothrot changed the title x/text: unicode/bidi API not implemented but code works fine x/text/unicode/bidi: API not implemented but code works fine Nov 3, 2020
@toothrot toothrot added the NeedsInvestigation label Nov 3, 2020
@toothrot
Copy link
Contributor

@toothrot toothrot commented Nov 3, 2020

/cc @mpvl

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 5, 2020

Change https://golang.org/cl/267857 mentions this issue: text/unicod/bidi: implement API, remove panics

@golang golang locked and limited conversation to collaborators Nov 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

3 participants