profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/mvdan/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Daniel Martí mvdan @protocol Sheffield, United Kingdom https://mvdan.cc I work on stuff in Go.

golang/dep 13131

Go dependency management tool experiment (deprecated)

cuelang/cue 3184

CUE has moved to https://github.com/cue-lang/cue

govim/govim 717

govim is a Go development plugin for Vim8, written in Go

libp2p/go-libp2p-core 109

Interfaces and abstractions that make up go-libp2p

mvdan/corpus 85

A corpus of popular Go modules

mvdan/bitw 78

Minimalist BitWarden client

mvdan/accesspoint 75

Manage wireless access points in Android (abandoned)

mvdan/benchinit 64

Benchmark the init cost of Go packages

filecoin-project/dealbot 22

🤖🤝 A bot for making deals

mvdan/android-template 16

Android app template

issue commentlibp2p/go-libp2p-pubsub

support waiting until a gossipsub topic has enough peers

I'm not sure how I can implement 5 in a way that doesn't poll.

With func WithReadiness(ready RouterReady) PubOpt, I need to supply a func(rt PubSubRouter, topic string) (bool, error). There's MinTopicSize, but that uses EnoughPeers, so that would get us back to polling at intervals, I think.

I see Topic has its own events like PeerJoin and PeerLeave, but if all I have is PubSubRouter and the topic string, it's not clear to me how to then make use of the Topic events.

I might just implement this with polling PubSubRouter.EnoughPeers for now, to get the API right, but it's certainly not the right internal implementation. Any hints appreciated, because I'm not sure how to do that.

mvdan

comment created time in 9 minutes

issue commentgolang/go

proposal: cmd/go: add per-test timeouts

My only remaining worry is what I outline in the last three paragraphs in https://github.com/golang/go/issues/48157#issuecomment-912402979 - that setting absolute time.Duration timeouts for each test feels too rigid. I think built-in support for a "scale" or multiplier would be necessary, e.g. for slower machines such as CI. Otherwise we'll either end up with realistic timeouts that cause sporadic failures on CI, or inflated timeouts that reduce flakes but take too long to make a test fail when locally iterating and testing.

A couple of comments later in the thread seem to agree that this problem warrants some attention. I personally think that some sort of multiplier seems like a sane solution, if you can roughly define what the "base" speed is - such as an average laptop from two years ago that's idle. This solution seems to have been working well enough for build.golang.org, as I understand some builders use a multiplier given slower hardware.

rsc

comment created time in 29 minutes

issue commentgolang/go

cmd/go: consider making "tool pprof" work with the module cache

I do imagine this might require something more than the current -source_path. Perhaps the ability to append "prefix maps" so we can:

  • map / to / (absolute paths, on by default)
  • map path@version to go env GOMODCACHE (module cache, on by default for Go)

And the user could add extra maps, like github.com/current/module to $PWD (minus the prefix).

mvdan

comment created time in 37 minutes

issue openedgolang/go

cmd/go: consider making "tool pprof" work with the module cache

I was just debugging a server's large memory usage, so via its http pprof endpoints, I downloaded some profiles.

The binaries running on that server were built with -trimprefix, because it's a sane default for "production builds", and enables reproducible builds too.

Unfortunately that means that, if I grab the deployed binary and some of its profiles, trying to use go tool pprof mostly works, but trying to inspect any source code fails:

$ go tool pprof ~/src/dvote/dvotenode heap
[...]
(pprof) list NewCache
Total: 2.20GB
ROUTINE ======================== github.com/dgraph-io/ristretto.NewCache in github.com/dgraph-io/ristretto@v0.1.0/cache.go
    2.41MB    21.05MB (flat, cum)  0.94% of Total
 Error: could not find file github.com/dgraph-io/ristretto@v0.1.0/cache.go on path /home/mvdan

Adding -source_path=$(go env GOMODCACHE) fixes those cases:

(pprof) list NewCache
Total: 2.20GB
ROUTINE ======================== github.com/dgraph-io/ristretto.NewCache in github.com/dgraph-io/ristretto@v0.1.0/cache.go
    2.41MB    21.05MB (flat, cum)  0.94% of Total
         .          .    164:	case config.MaxCost == 0:
         .          .    165:		return nil, errors.New("MaxCost can't be zero")
         .          .    166:	case config.BufferItems == 0:
         .          .    167:		return nil, errors.New("BufferItems can't be zero")
         .          .    168:	}
         .    18.15MB    169:	policy := newPolicy(config.NumCounters, config.MaxCost)
         .          .    170:	cache := &Cache{
[...]

This won't cover quite all cases, because the main module lacks a version, and might not even be in the module cache if I built from a git clone. Note the lack of @module-version in the error output, unlike my previous example involving a dependency:

(pprof) list LoadTree
Total: 2.20GB
ROUTINE ======================== go.vocdoni.io/dvote/census.(*Manager).LoadTree in go.vocdoni.io/dvote/census/census.go
         0     2.13GB (flat, cum) 97.15% of Total
 Error: could not find file go.vocdoni.io/dvote/census/census.go on path /home/mvdan/go/pkg/mod

I still think it would be neat for go tool pprof to come with a built-in -source_path=$(go env GOMODCACHE) default. As far as I can tell, it can't hurt. It won't be perfect with handling the main module either, but that's okay.

One alternative I do have, which will support listing all function sources, is to rebuild the same program with the same build flags but without -trimpath. Arguably that's the better solution if I want to be able to inspect all the source. However, that takes extra steps, and sometimes it might be difficult to figure out how to build a slight variant of exactly the same program at exactly the same version. So the sane(r) default that I propose here would probably be enough to perform a lot of list commands.

Yet another question is how I could tell go tool pprof that all the go.vocdoni.io/dvote module sources are in the directory /home/mvdan/src/dvote. I don't think -source_path is powerful enough for this right now, as I don't seem to be able to supply two paths. This also seems worth investigating in terms of UX, but it does seem like a separate idea.

cc @hyangah @aalexand @cherrymui

created time in 4 hours

issue commentmvdan/fdroidcl

Debian 10: "devices: could not get devices: failed to get device ABIs"

An alternative here would be to rewrite the code to fall back to separate adb shell getprop xxx commands if getting the entire list didn't work. At least that might make fdroidcl support more devices. I'm happy to review patches; see https://github.com/mvdan/fdroidcl/issues/56.

RoneoOrg

comment created time in 5 hours

issue commentmvdan/fdroidcl

Debian 10: "devices: could not get devices: failed to get device ABIs"

Yeah so that's the problem; with most devices, adb shell getprop prints all properties, and we rely on that to avoid multiple adb shell getprop xxx commands.

I can't really find canonical docs or manuals for the command, but every page I find seems to agree that, without arguments, it should print all properties.

RoneoOrg

comment created time in 5 hours

Pull request review commentipld/go-ipld-prime

schema,tests,gen/go: more tests, gen union fixes.

 package datamodel // so an error should only happen if a Node implementation breaks that contract. // It is generally not recommended to call DeepEqual on ADL nodes. func DeepEqual(x, y Node) bool {+	if x == nil || y == nil {

I guess this goes into whether an untyped nil node is valid. I think DeepEqual(nil, nil) should indeed return true, and that's consistent with reflect.DeepEqual and what most Go users would expect.

You don't even need another if branch for this; you can just do:

if x == nil || y == nil {
    return x == y
}
warpfork

comment created time in 5 hours

Pull request review commentipld/go-ipld-prime

schema,tests,gen/go: more tests, gen union fixes.

 package datamodel // so an error should only happen if a Node implementation breaks that contract. // It is generally not recommended to call DeepEqual on ADL nodes. func DeepEqual(x, y Node) bool {+	if x == nil || y == nil {

Also, I did write table-driven tests for DeepEqual, so please add coverage for this :)

warpfork

comment created time in 5 hours

PullRequestReviewEvent
PullRequestReviewEvent

issue commentgolang/go

Why does tls1.3 not support 0rtt?

See https://github.com/golang/go/issues/9671#issuecomment-519091516; I'm not sure if @FiloSottile has changed his plan after two years.

yangqingxin1993

comment created time in 7 hours

issue commentmvdan/fdroidcl

Debian 10: "devices: could not get devices: failed to get device ABIs"

The output that froidcl grabs which leads to your error is just adb shell getprop; then the output is parsed as a list of key-values. Can you share that?

RoneoOrg

comment created time in 7 hours

issue commentmvdan/fdroidcl

Debian 10: "devices: could not get devices: failed to get device ABIs"

The code in question is https://github.com/mvdan/fdroidcl/blob/1bd0f39050540dec815e93c7e4b10c4f8a52ba89/adb/device.go#L94-L135. My guess is that adb shell getprop isn't giving us the lines we expect, like ro.product.cpu.abilist.

RoneoOrg

comment created time in 17 hours

issue commentgolang/go

cmd/go: add a workspace mode

Thanks, split off into https://github.com/golang/go/issues/48589.

matloob

comment created time in 17 hours

issue openedgolang/go

cmd/go: add GOWORK env var mirroring GOMOD for the current workspace file

Split off from https://github.com/golang/go/issues/45713#issuecomment-925965205. go env GOMOD will be useful to tell if workspace mode is currently active, what workspace file is currently being used, as well as being able to provide enough information when reporting bugs with go env.

Adding to the 1.18 milestone for the sake of reporting bugs.

created time in 17 hours

issue commentburrowers/garble

Crashes on WebAssembly

Friendly bump.

Inkeliz

comment created time in 21 hours

delete branch mvdan/garble-fork

delete branch : drop-1.16

delete time in 21 hours

issue commentgolang/go

cmd/vet: "possible malformed +build comment" check too strict

I wonder if we could just remove this vet rule in the short term, given that the syntax is being superseded by //go:build.

eliasnaur

comment created time in a day

pull request commentipfs/go-ipfs

make json, cbor, and git codecs error on empty input

I can help tag go-ipld-git if needed, but go-ipld-prime is @warpfork's realm. Otherwise I don't think you need me for anything else here :)

mvdan

comment created time in a day

issue commentgolang/go

cmd/go: add a workspace mode

While attempting to use workspace mode at work, I keep wondering whether I'm in workspace mode or not, and I struggle to figure that out without trying builds to see what the behavior is like. I think go env GOMOD works really well to see what module I'm currently on; have we considered having go env GOWORK?

matloob

comment created time in a day

issue commentgolang/go

cmd/go: -workfile flag appears to not work at all

You're absolutely right that there are some tests, I apparently can't grep :)

mvdan

comment created time in a day

delete branch vocdoni/vocdoni-node

delete branch : feature/tx/updateCensusTx

delete time in a day

delete branch vocdoni/vocdoni-node

delete branch : feature/getProcessList_namespace

delete time in a day

delete branch vocdoni/vocdoni-node

delete branch : no-badgerhold-key

delete time in a day

delete branch mvdan/go-internal

delete branch : support-1.18

delete time in a day

push eventrogpeppe/go-internal

Daniel Martí

commit sha 86f73c5174517f64a171ff56b0fc5252242753db

testscript: add support for Go master aka 1.18 Fuzzing support brought a new parameter to MainStart, as well as more methods on testDeps. Use build tags to support those without breaking 1.16 nor 1.17. While at it, bump CI to test the two latest Go versions, and run 1.17's gofmt, as CI demands it. Finally, make CI also test with Go's master version, to ensure that we are compatible with it. We pin a specific commit, since that keeps CI stable. Fixes #144. Co-authored-by: Roger Peppe <rogpeppe@gmail.com>

view details

push time in a day

issue closedrogpeppe/go-internal

testscript: tip broke MainStart for fuzzing support

# github.com/rogpeppe/go-internal/testscript
go/pkg/mod/github.com/rogpeppe/go-internal@v1.8.1-0.20210531173208-9df06c38c09b/testscript/exe.go:231:8: not enough arguments in call to testing.MainStart

Looks like the merge of dev.fuzz last night added a parameter to MainStart. We should probably use build tags to insert an extra nil parameter on Go 1.18 and later.

closed time in a day

mvdan

PR merged rogpeppe/go-internal

testscript: add support for Go master aka 1.18

(see commit message)

+115 -9

2 comments

26 changed files

mvdan

pr closed time in a day

pull request commentwarpfork/go-testmark

fix parsing CRLF files, part 2

Friendly nudge. I don't have strong opinions here, but we should have a fix :) I'm happy to change the implementation here if Eric wants me to. I'm blocked on continuing work on portable CI for ipld-prime until then.

mvdan

comment created time in a day

pull request commentrogpeppe/go-internal

testscript: add support for Go master aka 1.18

@rogpeppe @myitcv test-gotip is now added. It takes about 3m, compared to just under 1m for the stable version. That is to be expected, as building from source takes between a minute and two on average hardware.

mvdan

comment created time in a day