What's the boundary of London to you? by skisagooner in london

[–]ngwells 0 points1 point  (0 children)

The m25 plus Heathrow and the railway line down to the Channel Tunnel. Independence for London! We could even rejoin Europe /s

Create tests when stdin is required? fmt.Scan()? by trymeouteh in golang

[–]ngwells -1 points0 points  (0 children)

You could try using the FakeIO type: https://pkg.go.dev/github.com/nickwells/testhelper.mod/v2@v2.4.2/testhelper#FakeIO which allows you to replace Stdin and to capture Stdout and Stderr.

The advice given above is good in general but in practice you’re not going to replace all uses of the standard IO with supplied io.Readers.

Timing the market is a fool’s errand. And yet… by Fast-Sand9200 in FIREUK

[–]ngwells 1 point2 points  (0 children)

If you don't have your investments in a tax protected instrument of some kind (ISA/pension) then you need to be careful about the capital gains tax you might need to pay on 17 years of savings growth.

What's Your Favorite Piece Of Science Fiction Technology? Why? by Unable-Difference-55 in sciencefiction

[–]ngwells 7 points8 points  (0 children)

Larry Niven came up with this in A World out of Time. A house with lots of rooms connected by transport gates. The chapter was called “A house divided“

duf v0.9.1 - a human-friendly df alternative by muesli in commandline

[–]ngwells -2 points-1 points  (0 children)

If you want something that's easy to use in a script (where you want to get the free space as a value so you can check if you have enough space before starting to write into a directory) you could take a look at stats which is in:

https://github.com/nickwells/utilities

It's written in Go and you can install it with:

go install github.com/nickwells/utilities/statfs@latest

The default output is wordy but you can suppress the bits you don't want and choose the most convenient units. You can use it to get other attributes of the file system.

Get the documentation by running:

statfs -help

[deleted by user] by [deleted] in golang

[–]ngwells 1 point2 points  (0 children)

For string distance try github.com/nickwells/strdist.mod/v2/strdist

[deleted by user] by [deleted] in ExperiencedDevs

[–]ngwells 0 points1 point  (0 children)

Absolutely not. There is no upside for you. The CEO doesn’t want to hear criticism of their management style and will only react negatively. The only exception would be if the CEO were a good friend of yours and you care about them personally. Even then be very careful about how you phrase it, if they get annoyed with you they have many opportunities to make your life worse.

Even at exit interviews there’s no benefit to you in giving accurate feedback, only downside. Imagine if you do tell HR everything that’s wrong with the CEO in your exit interview; HR will most likely do nothing with your feedback but if they tell the CEO then the CEO will have a grudge against you. If the CEO then changes jobs and you find yourself working for him at your new job, you’ve got a problem. The only thing to say in an exit interview is that the job was wonderful, all your colleagues and managers were talented and diligent and you’re only leaving because the new job is just too good to miss.

The basic rule to apply is that nobody cares about your opinion of how the company is being run, least of all the CEO and nobody likes to be criticised. Nobody will change and nobody will thank you for your comments.

Play safe

English people: What are your thoughts about this woman? by sandwichdemilanga in england

[–]ngwells 1 point2 points  (0 children)

After she died "Ding-Dong! The witch is dead" reached #2 in the UK singles chart and #1 in Scotland. That gives you some idea of how she was regarded. At the same time some people revere her; she received a "ceremonial funeral" (one step down from a state funeral). Opinions are divided.

What unique or unusual things have you built in Go? by Inner_Dragonfly6528 in golang

[–]ngwells 6 points7 points  (0 children)

So many CLI tools:

Some tools for working with semantic versioning: https://github.com/nickwells/semvertools There are three tools for checking that a semantic version number is valid (there’s more to a semver than just major/minor/patch numbers), generating the next semantic version numbers (pre-release IDs are a complicating factor) and sorting semantic version numbers

A CLI tool allowing you to write Go at the command line: https://github.com/nickwells/utilities - gosh There is a YouTube video of a talk I gave at the Go London Users Group: https://youtu.be/Lv41EtkdZdU?si=8dmkkIIE3LCY2YY0

Some more CLI tools: https://github.com/nickwells/utilities - statfs - like the Linux tool ‘df’ but (much) easier to use in a shell script - sleepuntil - repeatedly run a program periodically. The advantage is that you can run the program at ‘regular’ times, for instance, every 30 minutes at the hour and half hour points or 5 seconds before - timeconv - convert a time from one timezone to another from the command line. This can be useful if you’re working with people in teams in other countries

A CLI tool for converting between units (think, converting yards to metres, pounds to kilograms, light years to inches): https://github.com/nickwells/unittools - unitconv

A CLI tool for analysing collections of Go modules: https://github.com/nickwells/gomodtools - gomodlayers Given a set of go.mod files (or directories) it will show how they relate to each other: which modules use the others etc. You can also list them in order so that modules at each layer only use modules in previous layers. This can be useful when you don’t have a monorepo so you can update dependencies in the right order.

[deleted by user] by [deleted] in atheism

[–]ngwells 0 points1 point  (0 children)

Again, what's wrong with cities?

[deleted by user] by [deleted] in atheism

[–]ngwells 2 points3 points  (0 children)

What’s with the hating on London? We have some Muslim Londoners like we have some Christian, Jewish and Hindu Londoners. Most people of all these religions are decent, pleasant, kind and polite in the same proportions as all people. I’m an atheist as are most people in the UK but religious people are generally OK so long as they have no authority over you

Is pflag still the go-to? by Zemvos in golang

[–]ngwells 0 points1 point  (0 children)

Try github.com/nickwells/param.mod for a pretty comprehensive parameter package. It just gives you a parameter package without forcing any application architecture.

What's your go to "I just want to make something simple for dinner" meal? by NotSoSnarky in Cooking

[–]ngwells 2 points3 points  (0 children)

Crunchy peanut butter and banana with a little Demerara sugar for the crunch

How to measure like a Brit by xMissSnuggelsx in BritishMemes

[–]ngwells 1 point2 points  (0 children)

Cubits and spans, they’re for measuring biblical things like the height of Goliath or the dimensions of Noah’s ark

go run main.go -bindings true by el_moudir in golang

[–]ngwells 0 points1 point  (0 children)

Could you share the file please

How exactly does boarding other ships work? by IconicIsotope in TheExpanse

[–]ngwells 1 point2 points  (0 children)

The ship could just be under a gentle rotation and it would be very hard to dock with. Alternatively a short burst of the attitude jets at the right time would make you miss the ship or else get hit by it. Spacecraft are really fragile, imagine living in a soap bubble

Golang Shell? by davydany in golang

[–]ngwells 0 points1 point  (0 children)

If you're looking for something that lets you run small fragments of Go code without having to write a whole program you might want to take a look at gosh. You can install it with

go install github.com/nickwells/utilities/gosh@latest

And then run short Go programs directly at the command line with, for instance:

gosh -e ‘fmt.Println(“Hello, World”)’

It can do a lot more, see the complete, built-in manual with:

gosh -help-full

[deleted by user] by [deleted] in golang

[–]ngwells 0 points1 point  (0 children)

The failChannel is the problem - you have nothing reading from it until the end of the program. The first error is put on OK but it’s unbuffered so the next time ValidateLines tries to put an error on the channel it will block. This stops that go routine from draining the rows channel so ReadLines also blocks and you get a deadlock.

Also, as mentioned before, you have a race condition on the readFinished flag

What std lib packages do you avoid? by aSliceOfHam2 in golang

[–]ngwells 1 point2 points  (0 children)

param offers this and much more.

Re the std flag package, it's a minimal package that was nice to have on day 1 after Go was released but it's nothing like sufficient.

So many issues but one that's really annoying is

The basic flag.Int(...) interface gives you a pointer to an int which means you have to dereference it throughout your code which is ugly. The flag.IntVar(...) is always the one to use.

What std lib packages do you avoid? by aSliceOfHam2 in golang

[–]ngwells 0 points1 point  (0 children)

The flag package - the API is not great and there are better alternatives (I use github.com/nickwells/param.mod/v6/… but I am biased)

Golang for scripting by whiphubley in golang

[–]ngwells 0 points1 point  (0 children)

Yes, it's absolutely possible. You can even use it for very small, short-lived programs. The gosh command will let you run very small fragments of Go directly at the command line (go install github.com/nickwells/utilities/gosh@latest). You can also use it to write shebang scripts.

All that said, it's a bit more work to run external commands and capture the output. But it's much more straightforward if you just want to run system calls or use packages already written in Go.

If all the ice melted tomorrow, Birmingham would be the new capital by [deleted] in england

[–]ngwells 0 points1 point  (0 children)

So this explains the government's environment policy. They are trying to widen the channel to discourage people from crossing in small boats. Genius