Source identity
| Field | Recorded value |
|---|---|
| Source type | GitHub source |
| Original record | Janady13/missionmatch / cmd/corpus-harvest/dial_other.go |
| Date | Not specified in source |
| Repository | Janady13/missionmatch |
| Revision | 720d47fae476b0d38477ae4401697d372b1ea2bc |
| Branch | feature/opportunity-to-outcome |
| Path or archive member | cmd/corpus-harvest/dial_other.go |
| Original SHA-256 | 00a2f188a19b0a39d96ff4c9b7f2062c6296a24bfadbf188240935d23e0c44ee |
| Git blob SHA | 73268c3f767f745b103ef79c087a903a305dd011 |
| Reading-copy SHA-256 | 00a2f188a19b0a39d96ff4c9b7f2062c6296a24bfadbf188240935d23e0c44ee |
Recovered source transcript
Download complete source text ↓23 lines · 0.8 KB
//go:build !darwin
package main
import (
"context"
"fmt"
"net"
)
// Everywhere except macOS, interface binding is not the answer to anything this command has met, so asking
// for it is refused rather than silently ignored. A silent no op would let an operator set the variable on
// the Linux node, watch nothing change, and conclude the setting does not work anywhere.
//
// Linux has SO_BINDTODEVICE for the same purpose and it needs CAP_NET_RAW, so if a Linux node ever grows
// the same scoped route problem this is the file that gains the implementation.
func bindToInterface(name string) (func(ctx context.Context, network, addr string) (net.Conn, error), error) {
if name == "" {
return nil, nil
}
return nil, fmt.Errorf("binding a socket to interface %q is implemented for macOS only on this command", name)
}