Skip to content

Instantly share code, notes, and snippets.

Avatar
👁️

Liam networkimprov

👁️
View GitHub Profile
@networkimprov
networkimprov / txt.md
Last active Sep 17, 2021
Requirements to Consider for Go 2 Error Handling
View txt.md

Requirements to Consider for Go 2 Error Handling

Towards consensus on the requirements for a new errors idiom.

The Go2 Error Handling Overview gives only four rather vague "goals": small-footprint error checks, developer-friendly error handlers, explicit checks & handlers, and compatibility with existing code. It makes no mention of potential future extensions of the concept. Previously @ianlancetaylor made a similar list in Github issue #21161.

@networkimprov
networkimprov / txt.md
Last active Dec 4, 2018
Please Don't Mangle the Function Signature, re Go2 generics proposal
View txt.md

For gosh sakes, don't make us read code with the scrutiny of a compiler :-) A type declaration after a function name is confusingly similar to an argument list.

Which witch is which?

  • func Stuff(type T Something)(input T) error { ... }
  • func Stuffed(input Somethingelse) error { ... }

C++ style is fine; variations on paren placement can be considered

  • (type T, U) Something // line break or semicolon
    (type V) // more on next line
@networkimprov
networkimprov / txt.md
Last active Sep 5, 2018
Missing Multiple Error Handlers (a Revised Handler Concept), re Go2 handle/check proposal
View txt.md

Now posted on the golang issue tracker, #27519.

The #id/catch error model, a revision of check/handle

Appreciations to the Go team for presenting a thoughtful and detailed set of Go2 draft designs. The Error Handling Draft is great for logging errors via the handler chain, and returning them succinctly. However, Go programs commonly:

a) handle an error and continue the function that received it, and

@networkimprov
networkimprov / log.txt
Created Nov 4, 2015
archlinuxarm-armv7-latest on qemu boot log
View log.txt
[ OK ] Reached target Timers.
Starting Network Service...
[ OK ] Started Permit User Sessions.
[ OK ] Started Getty on tty1.
[ 34.455182] input: AT Raw Set 2 keyboard as /devices/platform/smb/smb:motherboard/smb:motherboard:iofpga@3,00000000/1c060000.kmi/serio0/input/input0
[ OK ] Started Login Service.
[ OK ] Found device /dev/ttyAMA0.
[ OK ] Started Serial Getty on ttyAMA0.
[ OK ] Reached target Login Prompts.
[ 35.892345] libphy: smsc911x-mdio: probed
View gist:12bf0487e5d70b483934
drwxr-xr-x 11 root root 0 Oct 31 08:10 .
-rw-r--r-- 1 root root 2562 Oct 31 08:10 ./buildconfig
-rw-r--r-- 1 root root 96 Oct 31 08:10 ./config
-rwxr-xr-x 1 root root 466 Oct 31 08:10 ./sbinit.sh
-rwxr-xr-x 1 root root 679 Oct 31 08:10 ./wipek.sh
-rw-r--r-- 1 root root 4364 Oct 31 08:10 ./init
drwxr-xr-x 2 root root 0 Oct 31 08:10 ./hooks
-rwxr-xr-x 1 root root 529 Oct 31 08:10 ./hooks/udev
-rw-r--r-- 1 root root 12469 Oct 31 08:10 ./init_functions
-rw-r--r-- 1 root root 2 Oct 31 08:09 ./VERSION
View bugapp.js
var lib = require('./buglib.js');
lib.on('connect', function() {
console.log('library ready');
throw new Error('test throw');
console.log('done');
});
lib.init(null);
@networkimprov
networkimprov / stattest.js
Created Oct 29, 2011
Async filesystem ops vs. OS filesystem cache
View stattest.js
var fs = require('fs');
var sMax = 500000;
var sDir = 'teststat';
var sCount = 2;
if (!fs.statSync(sDir)) {
fs.mkdirSync(sDir, 0700);
for (var a=0; a < 100; ++a)
fs.writeFileSync(sDir+'/'+a, 'some text');
@networkimprov
networkimprov / fs.utimes patch
Created Mar 3, 2011
may need to be rebased...
View fs.utimes patch
From 9f74e3f74ccb35d40ac61b24ad21b11c034df2fa Mon Sep 17 00:00:00 2001
From: Ben Noordhuis <info@bnoordhuis.nl>
Date: Fri, 29 Oct 2010 12:38:13 +0200
Subject: [PATCH] fs.utimes() and fs.futimes() support.
---
lib/fs.js | 39 +++++++++++++
src/node_file.cc | 80 ++++++++++++++++++++++++++
test/simple/test-fs-utimes.js | 123 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 242 insertions(+), 0 deletions(-)
@networkimprov
networkimprov / style.css
Created Jan 28, 2011
doc/all_files/style.css with right-margin TOC pane
View style.css
/*--------------------- Layout and Typography ----------------------------*/
body {
// font-family: "Helvetica Neue", Helvetica, FreeSans, Arial, sans-serif;
font-family: Georgia, FreeSerif, Times, serif;
font-size: 0.9375em;
line-height: 1.4667em;
color: #222;
margin: 0; padding: 0;
}
a {
View sw-dependencies.txt
Dependencies for elembe
Application [/home/elembe/lib/] http://github.com/networkimprov/elembe
[runs as user elembe]
Socket.IO [/home/elembe/lib/socket.io/] http://github.com/LearnBoost/Socket.IO
Node.js 0.2.5+ http://github.com/ry/node
Node modules [/usr/lib/nodelib/(module_name without 'node' prefix/suffix)]
inotify [C++] http://github.com/c4milo/node-inotify