errcheck
CPython
errcheck | CPython | |
---|---|---|
9 | 1,314 | |
2,284 | 59,658 | |
- | 1.0% | |
6.3 | 10.0 | |
15 days ago | 3 days ago | |
Go | Python | |
MIT License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
errcheck
-
Linter to check for errors ignored with _
In our codebase I noticed a few cases where people ignored errors returned from functions by assigning them to _, ie result, _ := foo(). The errcheck linter doesn't seem to catch this, does anyone know of a linter that does?
-
Golang panics in libraries
And we also expect that the caller will check the error and handle it. There is a popular linter that checks it for us: errcheck.
-
Is it a bad convention to overwrite err variable?
You should be using golangci-lint, because all serious Go programmers should. golangci-lint contains errcheck, which will detect if you overwrite an error without having done something with it in the meantime. I consider this one of the most important linters (this doesn't just detect things that may sorta kinda someday turn into bugs, this quite likely is a bug RIGHT NOW), and it helps you have the confidence you can overwrite errors as you go and don't need to keep allocating new ones.
-
Integration Tests failing
Run golangci-lint over your code if you haven't already and pay special attention to errcheck's output.
-
Luciano Remes | Golang is πΌπ‘π’π€π¨π© Perfect
errcheck has a flag for that ;)
-
Proposal: Go 2: Lightweight anonymous function syntax
https://github.com/kisielk/errcheck, which is in most of the combined linter packages by default.
We'll agree to disagree about unused imports; imports have can side-effects.
-
Lies we tell ourselves to keep using Golang
I prefer functions returning errors over throwing exceptions. Whether it's Go's errors or ML-style options/results, they're both better than exceptions. I cannot remember the last time I had a bug from not checking an error in Go. There's also errcheck which I use as part of my linting that will catch unchecked errors, such that I cannot even commit the code.
-
I Want Off Mr. Golang's Wild Ride
> Go compiler raise an error if a variable (error) goes unused
It doesn't though. It's perfectly valid to not use the return value of a function that only returns an error, for instance.
There are static error checking tools you can use like https://github.com/kisielk/errcheck to work around this, but most people don't use them.
I've run into a lack of Go error checking many times. Many times it's just the trivial case, where the compiler doesn't warn about not checking the result of an error-returning function.
But often it'll be subtler, and the result of Go's API design. One example is its file writing API, which requires you to close the file and check its error to be correct. Many times people will just `defer file.Close()`, but that isn't good enough - you're ignoring the error there.
Worse still is e.g: writing to a file through a bufio.Writer. To be correct, you need to remember to flush the writer, check that error, then close the file and check that error. There's no type-level support to make sure you do that.
-
Trying Out Generics in Go
I'd be really happy with that! Building the functionality of errcheck[1] and ineffassign[2] into the compiler β or at the very least, into govet β would go a long way to allay my worries with Go.
I think the reason they don't do this is that it's a slight (albeit a very tiny one) against Go's philosophy of errors being values, just like any other. While the `error` type is standard and used throughout Go source code, it still just has a simple three-line definition[3] and is not treated as a special case anywhere else; there is nothing stopping you from returning your own error type if you wish. A third-party linter could simply check for the `error` type specifically, but the first-party tools should not, and there's nothing like Rust's `#[must_use]` attribute that could be used instead. I respect Go's philosophy, but I feel like pragmatism must win in this case.
[1]: https://github.com/kisielk/errcheck
CPython
-
scrape-yahoo-finance
Web Scraping Tool Development: Develop a Python based web scraping tool capable of extracting data from targeted web pages on Yahoo Finance and presenting the data extracted in a readable format. Our target site relies on AJAX to load and update the data dynamically so we will need a tool that is capable of processing JavaScript.
-
Employee Management System using Python.
Dealing with piles of papers or scattered Excel sheets for employee information can be a real headache, right? Well, what if I told you there's a smoother way to handle all that? A system that lets you easily store, update, and find details about your employees in just a few clicks. Sounds neat, doesn't it? In this article, we're going to explore creating an employee management system using Python, Tkinter, and SQLite3.
-
Build a Product Receipt Generator using Python.
Python is a versatile tool, and today we're delving into a practical use case that can simplify your daily routines. With the datetime module at your disposal, handling dates and times becomes a breeze, making it perfect for crafting accurate and dynamic product receipts. Whether you're a seasoned Python pro or just starting your coding journey, this article will guide you through each step with ease.
-
Build a Music Player with Python
When working in Visual Studio Code (VS Code), create a new Python file for our music player project. It's helpful to have separate files for different parts of your project.
-
PEP 744 β JIT Compilation
> It provides a meaningful performance improvement for at least one popular platform (realistically, on the order of 5%).
At first it will not provide a large boost, but it will set the foundations for larger gains in subsequent releases. They link a list of some proposed improvements already underway, with improvement estimates, at https://github.com/python/cpython/issues/115802
-
Featured Mod of the Month: Phil Ashby
After that, with the basics of software engineering understood, I would move on to a wider use language, with a bigger ecosystem to employ, most likely Python. This would expose me to large system design / distributed systems and architectural challenges...
-
Convert Images Into Pencil Sketch
Have you ever felt like your photos needed a little extra touch to stand out? Well, get ready because we're about to learn a cool Python trick! We're going to take ordinary photos and turn them into awesome pencil sketches using Python and OpenCV. This will make your pictures look like they were drawn by hand!
-
Crafting an Image to PDF Converter App Using Python
Have you ever found yourself in a situation where you needed to convert a bunch of images into a PDF file quickly and efficiently? Imagine the convenience of converting a series of images from your recent trip into a single PDF album with just a few clicks. In this article, we will cover the process of building an Image PDF Converter App using Python. With the help of libraries like tkinter, os, and Python Imaging Library (PIL), we'll walk through the process of creating a powerful tool that can streamline this task for you.
-
Calculator with GUI Using Python Tkinter
If you've ever wanted to learn how to use Python or if you already know a bit and want to try something new, then you're in the right place! In this article, we'll show you step-by-step how to make your very own calculator using Python's Tkinter library, a renowned Python library for creating graphical user interfaces. Tkinter stands out for its simplicity, versatility, and widespread use in the Python community. It doesn't matter if you're a total beginner or an experienced coder looking for a fun project, we'll guide you through everything you need to know.
-
Back to Basics - Pandas #1
Pandas is an open source, BSD-licensed library providing high-performance, easy-to-use data structures and data analysis tools for the Python programming language.
What are some alternatives?
GoLint - [mirror] This is a linter for Go source code. (deprecated)
RustPython - A Python Interpreter written in Rust
staticcheck
ipython - Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.
gosimple
Vulpix - Fast, unopinionated, minimalist web framework for .NET core inspired by express.js
gcvis - Visualise Go program GC trace data in real time
Visual Studio Code - Visual Studio Code
apicompat - apicompat checks recent changes to a Go project for backwards incompatible changes
Automatic-Udemy-Course-Enroller-GET-PAID-UDEMY-COURSES-for-FREE - Do you want to LEARN NEW STUFF for FREE? Don't worry, with the power of web-scraping and automation, this script will find the necessary Udemy coupons & enroll you for PAID UDEMY COURSES, ABSOLUTELY FREE!
Go Metalinter
Pandas - Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more