u/chrj

1,093 post karma · 1,119 comment karma · joined Aug 2006 · moderator

chrj

You can have DNS-01 challenges too if you use https://github.com/caddyserver/certmagic instead

It has a similar API to autocert

chrj

Not sure if you're the author, but how did you find working with Gerrit for code reviews rather than through GitHub PRs?

chrj

They mean the ticket number starts with 157, meaning it was issued by them and not another (partner) airline.

chrj

Zone 516 is pretty far down the line

chrj
chrj

One rule of thumb I've adopted is that, for package developers, concurrency for the vast majority of use cases should be the responsibility of the caller. What that means is that it's perfectly fine for you to expose long, blocking methods in your API. Rather than polluting your API with sync or async versions of methods, callbacks or other things, keep it simple and let the caller decide whether or not to run in a goroutine, use an errgroup, develop a producer/consumer architecture or something third.

chrj

What's the benefit of:

u0 := *factoryBlueue.MustCreateWithOption(map[string]any{
    "Location": "Tokyo_0",
}).(*entity.User)

Over:

u0 := &entity.User{Location: "Tokyo_0"}
chrj

You need to run go mod tidy. Your go.mod is full of indirect, unused dependencies.

chrj
  • Your file package should be in internal/file/ not at the root of internal/ The purpose of internal/ is to hide internal APIs from internal packages from external packages - not to be a package on its own.
  • Package file is a bit of a vague and confusing name for what the package holds. In order to discover good package names, one thing I like to think of the qualified type names the package holds: in your case file.Column and file.CSV. Maybe there's a better name than file?
  • It looks like your program loads all data into memory before dumping it to excel. That will put a hard limit on the file sizes you can support. Is there a way you can stream the data instead and not hold everything in-memory?
  • There's no tests
chrj

You got it!

chrj

The latter is a special case of switch: Type Switch

chrj

Just hold the power button until it resets.

chrj

Maybe your roundtripper can clone your request first. Then you will not modify the (original) request at least.

chrj

For something that claims to be durable, there's a worrying lack of tests to support that claim.

chrj

Lovgivningen indeholder også sandsynlighedsforsæt.

chrj

Where's your tests?

chrj

What's the timeout values for your http.Server? Defaults are unlimited.

chrj

I'd argue that a Makefile is a bit of an antipattern for Go.

You should have a very good reason to use it instead of relying on standard workflows like go install / go build / go get / go test keeping things simple and compatible with the Go ecosystem.

chrj

What's slow about them? The CPUs? The support? The network?

chrj

Skægvækst og antal hiphop tracks udgivet

chrj

You're right that you should initialize your slice with make() before calling Read() and that is indeed an allocation. But when reading a file, you would typically have more than one call to Read(), and you can then reuse that slice once you've processed the data you got in the first call avoiding another allocation.

In terms of what's happening during the call, the documentation says:

Read reads up to len(b) bytes from the File and stores them in b. It returns the number of bytes read and any error encountered. At end of file, Read returns 0, io.EOF.

That means you control how many bytes can be read at every call and where they'll be (temporarily) stored. Keep in mind though, that in many circumstances, your slice will not be filled, so you must only read up to n bytes from it (n is one of the return values of the function).

chrj

It puts the caller in charge of allocations. So you can decide yourself if you want to reuse the slice and how big you want the slice to be.

chrj

Sæsonen for amerikansk fodbold er lige startet. I København og omegn kan i se den bedste danske række, Nationalligaen, ved at tage til Copenhagen Towers (på Gentofte Stadion) eller Søllerød Gold Diggers (på Rundforbi Stadion).

https://resultater.daff.dk/tms/Turneringer-og-resultater/Pulje-Komplet-Kampprogram.aspx?PuljeId=497

Den 18. maj spiller Copenhagen Towers mod Triangle Razorbacks fra Vejle som uden tvivl bliver et top-brag.

chrj
chrj

Have you considered having the caller pass a slice into your method that you can use for storing the results in and then returning an int of how many rows you wrote to it?

That would also (potentially) save a heap allocation for each call.