Searching yarn

Twts matching #Gopher.
Sort by: Newest, Oldest, Most Relevant

@s4rag0ldman@vaporhole.xyz eu também já formatei bastante, vou até adicionar uma parte que esqueci no meu relato. Como o NixOS é construído a partir de uma fonte escrita em linguagem nix, meu sistema anterior tava praticamente salvo o registro, um comando de terminal e eu tinha tudo de volta. Já tá la no meu gopher a história quase toda.

⤋ Read More

Je suis en plein réflexion. Je cherche à me déconnecter, et lire hors ligne après synchronisation. Un peu comme le fait offpunk. Cependant, ça ne me convient pas, la navigation en ligne revient trop vite; Je veux récupérer les changements des sites puis les lire. RSS/ATOM (mastodon en génère), c’est parfait pour ça, je lis tout avec rss2email. Comment faire de même pour #gemini et #gopher? Je rêve d’ouvrir mon terminal, puis de parcourir les nouveautés sans clics

⤋ Read More

Commentaire du code pour un service de lecture over ssh (et je me la pète au passage avec plein de liens #C ) : https://si3t.ch/log/2023-11-13-txtoverssh.c.txt gopher://si3t.ch/0/log/2023-11-13-txtoverssh.c.txt gemini://si3t.ch/log/2023-11-13-txtoverssh.c.txt http://6gvb6fzoxv72mtlpvr2fgj7ytpeggwuerdawspt24njlkwfxir6jncid.onion/log/2023-11-13-txtoverssh.c.txt gopher://of2w2p5f4hsslk63hmo6tid6r7inhlxuxviq4pb5cxg45enswpbrfjad.onion/0/log/2023-11-13-txtoverssh.c.txt gemini://b2khgkvb2wn4avjshjp63kknsjwikgwff5dwwydldia6qwf4kdnueyad.onion/log/2023-11-13-txtoverssh.c.txt ou encore ‘ssh lire@si3t.ch’ numéro 45.

⤋ Read More

Question to all you Gophers out there: How do you deal with custom errors that include more information and different kinds of matching them?

I started with a simple var ErrPermissionNotAllowed = errors.New("permission not allowed"). In my function I then wrap that using fmt.Errorf("%w: %v", ErrPermissionNotAllowed, failedPermissions). I can match this error using errors.Is(err, ErrPermissionNotAllowed). So far so good.

Now for display purposes I’d also like to access the individual permissions that could not be assigned. Parsing the error message is obviously not an option. So I thought, I create a custom error type, e.g. type PermissionNotAllowedError []Permission and give it some func (e PermissionNotAllowedError) Error() string { return fmt.Sprintf("permission not allowed: %v", e) }. My function would then return this error instead: PermissionNotAllowedError{failedPermissions}

At some layers I don’t care about the exact permissions that failed, but at others I do, at least when accessing them. A custom func (e PermissionNotAllowedError) Is(target err) bool could match both the general ErrPermissionNotAllowed as well as the PermissionNotAllowedError. Same with As(…). For testing purposes the PermissionNotAllowedError would then also try to match the included permissions, so assertions in tests would work nicely. But having two different errors for different matching seems not very elegant at all.

Did you ever encounter this scenario before? How did you address this? Is my thinking flawed?

⤋ Read More