mdlayher
Repos
123
Followers
1631
Following
29

Package netlink provides low-level access to Linux netlink sockets (AF_NETLINK). MIT Licensed.

744
79

Package vsock provides access to Linux VM sockets (AF_VSOCK) for communication between a hypervisor and its virtual machines. MIT Licensed.

268
56

Package packet provides access to Linux packet sockets (AF_PACKET). MIT Licensed.

54
6

CoreRAD is an extensible and observable IPv6 Neighbor Discovery Protocol router advertisement daemon. Apache 2.0 Licensed.

122
11

Package wgctrl enables control of WireGuard interfaces on multiple platforms.

540
64

Talks by Matt Layher. MIT Licensed.

57
6

Events

issue comment
TestIntegrationClientLinkInfos fails with "operation not supported"

Should be fixed as of https://github.com/mdlayher/ethtool/commit/5605e9b8817d4b1f44bc8f95934a984ef3a5e831.

Created at 2 days ago

go.mod: bump dependencies, Go 1.19

Signed-off-by: Matt Layher mdlayher@gmail.com

ethtool: skip integration test on EOPNOTSUPP

Signed-off-by: Matt Layher mdlayher@gmail.com

Created at 2 days ago
delete branch
mdlayher delete branch mdl-keylight
Created at 6 days ago
create branch
mdlayher create branch mdl-modemmanager
Created at 6 days ago
pull request opened
prometheus-keylight-exporter: 0.1.1 -> 0.2.0

Signed-off-by: Matt Layher mdlayher@gmail.com

Description of changes

Mostly dependency updates, fix darwin build.

Things done
  • Built on platform(s)
    • [x] x86_64-linux
    • [ ] aarch64-linux
    • [ ] x86_64-darwin
    • [ ] aarch64-darwin
  • [ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • [x] Tested, as applicable:
  • [ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • [x] Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • [ ] (Package updates) Added a release notes entry if the change is major or breaking
    • [ ] (Module updates) Added a release notes entry if the change is significant
    • [ ] (Module addition) Added a release notes entry if adding a new NixOS module
    • [ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • [ ] Fits CONTRIBUTING.md.
Created at 6 days ago
create branch
mdlayher create branch mdl-keylight
Created at 6 days ago
pull request opened
prometheus-modemmanager-exporter: 0.1.0 -> 0.2.0

Signed-off-by: Matt Layher mdlayher@gmail.com

Description of changes

Mostly dependency updates, fix darwin build.

Things done
  • Built on platform(s)
    • [x] x86_64-linux
    • [ ] aarch64-linux
    • [ ] x86_64-darwin
    • [ ] aarch64-darwin
  • [ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • [x] Tested, as applicable:
  • [ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • [x] Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.11 Release Notes (or backporting 22.05 Release notes)
    • [ ] (Package updates) Added a release notes entry if the change is major or breaking
    • [ ] (Module updates) Added a release notes entry if the change is significant
    • [ ] (Module addition) Added a release notes entry if adding a new NixOS module
    • [ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • [ ] Fits CONTRIBUTING.md.
Created at 6 days ago
closed issue
About Go 1.18 new feature: GeniericType

What version of Go are you using (go version)?

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

What did you do?

below the code, compile is failed error message is: *Foo does not implement []any|*any

I guest that *Foo need not implement []any|*any`. this is only type constraints. why happened,please help me!!!

type Foo struct {}

type Optional[T []any | *any] interface {
	IsNil() bool
	Value() T
	Unwrap() T
}

type emptyValue[T []any | *any] struct {
	t T
}

func (ev *emptyValue[T]) IsNil() bool {
	return ev.t == nil
}

func (ev *emptyValue[T]) Value() T {
	return ev.t
}

func (ev *emptyValue[T]) Unwrap() T {
	return ev.t
}

func NonNullWrap[T []any | *any](t T) Optional[T] {
	return &emptyValue[T]{t: t}
}

func NullWrap[T []any | *any](t T) Optional[T] {
	return &emptyValue[T]{t: t}
}

func Flat[T []any | *any, V []any | *any](t Optional[T], f func(t T) V) Optional[V] {

	if t.IsNil() {
		return &emptyValue[V]{}
	}

	return NullWrap(f(t.Value()))
}

func main() {

	foo := &Foo{}
	ops := NullWrap(foo)

	v := Flat(ops, func(v *Foo) *Foo {
		return &Foo{}
	})

	Flat(v, func(l *Foo) *Foo {
		return &Foo{}
	})
}

What did you expect to see?

I guest that *Foo need not implement []any|*any`. this is only type constraints. why happened,please help me!!!

What did you see instead?

Created at 1 week ago
issue comment
About Go 1.18 new feature: GeniericType

Please see https://github.com/golang/go/wiki/Questions.

Created at 1 week ago
closed issue
proposal: Hope next Go or Go2 can support GenericType Method of GenericType Interface or Struct

I hope next Go or Go2 can support GenericType Method of GenericType Interface or Struct In order to Implement FP paradigm. like this

type Result[T any] interface {
	AndThen[V any](fn func(t T) Result[V]) Result[V]
}

type emptyResult[T any] struct {
	t   T
	err error
}

func Wrap[T any](t T) Result[T] {
	return &emptyResult[T]{t: t}
}

func (er *emptyResult[T]) AndThen[V any](fn func(t T) Result[V]) Result[V] {
	if er.Err() != nil {
		return errWrap[V](r.Err())
	}
	return fn(er.Ok())
}

func main() {

        r := Wrap(3).AndThen(func(t int) Result[string] {
		return Wrap("GenericType")
	}).AndThen(func(t string) Result[*Foo] {
		return Wrap(&Foo{})
	})
	
	println("foo: ", r.t)
}
Created at 1 week ago
issue comment
proposal: Hope next Go or Go2 can support GenericType Method of GenericType Interface or Struct

There are numerous other issues about supporting generic methods and since this is more of a comment than an actionable issue, I'm going to close this out.

Created at 1 week ago
closed issue
go-fuzz does not work with cgo

Hello, I previously used go-fuzz with Go 1.4.2, but now that I'm on 1.5.1, it no longer seems to work. In addition, when switching back to 1.4.2, it doesn't seem to work anymore either.

I just nuked my $GOPATH and reinstalled from scratch, just to see what would happen. It still doesn't seem to work. Any ideas?

Thanks for your time.

[zsh|matt@nerr-2]:~/git/go 0 % go version
go version go1.5.1 linux/amd64
[zsh|matt@nerr-2]:~/git/go 0 % go get github.com/mdlayher/ethernet                                                                                                                                       [zsh|matt@nerr-2]:~/git/go 2 % go get github.com/dvyukov/go-fuzz/go-fuzz                                                                            
[zsh|matt@nerr-2]:~/git/go 0 % go get github.com/dvyukov/go-fuzz/go-fuzz-build
[zsh|matt@nerr-2]:~/git/go 0 % cd src/github.com/mdlayher/ethernet 
[zsh|matt@nerr-2]:~/git/go/src/github.com/mdlayher/ethernet 0 (master) ± cat fuzz.go 
// +build gofuzz

package ethernet

func Fuzz(data []byte) int {
        f := new(Frame)
        if err := f.UnmarshalBinary(data); err != nil {
                return 0
        }

        if _, err := f.MarshalBinary(); err != nil {
                panic(err)
        }

        if err := f.UnmarshalFCS(data); err != nil {
                return 0
        }

        if _, err := f.MarshalFCS(); err != nil {
                panic(err)
        }

        return 1
}
[zsh|matt@nerr-2]:~/git/go/src/github.com/mdlayher/ethernet 0 (master) ± go-fuzz-build github.com/mdlayher/ethernet
[zsh|matt@nerr-2]:~/git/go/src/github.com/mdlayher/ethernet 0 *(master) ± go-fuzz -bin=./ethernet-fuzz.zip -workdir=fuzz/
2015/09/16 11:19:51 slaves: 8, corpus: 1 (3s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 3s
2015/09/16 11:19:54 slaves: 8, corpus: 1 (6s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 6s
2015/09/16 11:19:57 slaves: 8, corpus: 1 (9s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 9s
2015/09/16 11:20:00 slaves: 8, corpus: 1 (12s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 12s
2015/09/16 11:20:03 slaves: 8, corpus: 1 (15s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 15s
2015/09/16 11:20:06 slaves: 8, corpus: 1 (18s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 18s
2015/09/16 11:20:09 slaves: 8, corpus: 1 (21s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 21s
2015/09/16 11:20:12 slaves: 8, corpus: 1 (24s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 24s
2015/09/16 11:20:15 slaves: 8, corpus: 1 (27s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 27s
^C2015/09/16 11:20:17 shutting down...
Created at 1 week ago
closed issue
wireguardctrl has been moved and renamed to wgctrl

Hello, I've spotted your project as a user of my wireguardctrl project and wanted to reach out to let you know that the project has been moved to the WireGuard org and the main package has been renamed:

https://godoc.org/golang.zx2c4.com/wireguard/wgctrl

It should be fairly easy to update, but feel free to reach out if you run into any issues. Thanks!

Created at 1 week ago
closed issue
internal/wgfreebsd: support for new FreeBSD kernel interface

@mattmacy is working on a FreeBSD kernel implementation of WireGuard at https://github.com/mattmacy/wg-fbsd and the repo is going to be moved to https://git.zx2c4.com/wireguard-freebsd/about/ soon. We should support this interface.

Created at 1 week ago

go.mod: tidy

Created at 1 week ago

cmd/ndp: remove ra, simplify help

Created at 1 week ago
mdlayher create tag v0.2.0
Created at 1 week ago
mdlayher delete branch master
Created at 1 week ago
mdlayher create branch main
Created at 1 week ago

modemmanager_exporter: actions and go.mod updates

Created at 1 week ago

keylight: fix staticcheck warnings

Created at 1 week ago

modemmanager: actions and go.mod updates

Created at 1 week ago
create branch
mdlayher create branch main
Created at 1 week ago
delete branch
mdlayher delete branch master
Created at 1 week ago