People complain too much about error handling in #Go. Like it or not, go treats errors like any other value. Since the compiler forces you to use all return values of functions, unless you specifically discard the error, you're always aware of which functions can error and that goes a long way to improve the reliability of your software.
Java has checked exceptions, JavaScript trusts you to know that a function 20 slots down the call stack has an unhandled error.
A critical vulnerability, named BatBadBut, was discovered in the Rust programming language, affecting not just Rust but also Erlang, Go, Python, Ruby, and potentially others. This vulnerability, with a severity score of 10/10, could allow attackers to execute arbitrary commands on Windows systems by exploiting how Rust handles batch files. The issue arises from Rust's standard library improperly escaping arguments when invoking batch files on Windows, leading to potential command injection. The vulnerability has been addressed with a fix in Rust version 1.77.2, which developers are urged to update to. Other programming languages and systems, including Node.js, PHP, and Java, are also affected and are working on patches.
why:
std::string a = "Hello world";
if (a.find('r') != std::string::npos)
fmt::println("{}", pos);
else
fmt::println("not found");
and why not:
std::string a = "Hello world";
if (a.contains('r')) // Do member function overloading in the class
fmt::println("{}", pos);
else
fmt::println("not found");
why standard doesn't implement trimming functions for white spaces? why do I always have to rely on iterators for such things... (it's just feels like I've to type too much for a basic functionality)
@cuddle
Sometimes when I need a break I go over and code something small with #Go
It is quite relaxing to do something in much less lines of code.
I love C in generel - the simplicity is divine.
Just sometimes one needs a break 🙂
I lack C++ experience... the small things I do on C++ does not make me competent to give any kind of experience.
Chewing away on code can be daunting, that is for sure.
What’s your favorite library in #Go#Golang for web authentication? Or any other recommendation to implement it (like std lib or just a JWT one etc).
Ideally it supports classic credentials, 2FA and passkeys. Bonus for OAuth providers that you can extend (if it does not support Mastodon out of the box for example).
Is there a language like #Rust (compiles to native binary, preferably without GC or manual memory management, has an easy-to-use build system) that also doesn't end up pulling in hundreds of transitive dependencies? Ideally what I'd want is like Rust but with #Python's standard library, capable of handling most basic tasks (even if external dependencies would make life easier). I often look at #Go but I don't want to tangle myself up with Google anymore than I already have
Як працюють компіляція та виконання коду👇
🔸Компілювані мови (#C, C++, #Go)
Вихідний код перетворюється компілятором на машинний. Машинний код виконується безпосередньо процесором.
🔸Байт-код (#Java, C#)
Вихідний код компілюється у байт-код, а потім JVM виконує програму. Іноді JIT-компілятор компілює вихідний код у машинний, щоб прискорити виконання.
🔸Інтерпретовані мови (#Python, #JS, #Ruby)
Тут для виконання програми не потрібен машинний код, натомість програму рядково виконають інтерпретатори.
#GotoSocial does not list ‘unlisted’ posts on your profile page when loaded in the browser … without authentication.
This may not be new to some of you, but I just realised how big of a deal that is. It means that it kinda operates like local-only posts for randos, in that they aren’t viewable by anyone who isn’t your “friend”.
i’m sure there is more to it than just that, but the brain is foggy today … and … come on … that is huge.
i need to focus on learning #go as soon as i get back… the more time i spend with it, the more i am in-love with it and i wanna help the team… i wanna feel useful.
It also introduces a small #Go CLI utility I made to get both extended KEV and NVDv2 CVE data back in one call (code @ https://codeberg.org/hrbrmstr/vccve).
@Mikie1600 J'ai aussi une version obscure capturée après avoir battu Giovanni. Celui-là viens de l'événement de ce week-end, troisième raid enfin une capture est ... Grosse déception. Du coup pour me venger je l'ai appelé Findus :D
J'ai rien contre le grind de #go mais j'ai pas le courage d'enchaîner la team rocket ou les raid pour les bonbons pour la méga énergie donc ça restera juste un trophée sur l'étagère