Source file src/net/net_fake_js.go

     1  // Copyright 2023 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Fake networking for js/wasm. It is intended to allow tests of other package to pass.
     6  
     7  //go:build js && wasm
     8  
     9  package net
    10  
    11  import (
    12  	"context"
    13  	"internal/poll"
    14  
    15  	"golang.org/x/net/dns/dnsmessage"
    16  )
    17  
    18  // Network file descriptor.
    19  type netFD struct {
    20  	*fakeNetFD
    21  
    22  	// immutable until Close
    23  	family int
    24  	sotype int
    25  	net    string
    26  	laddr  Addr
    27  	raddr  Addr
    28  
    29  	// unused
    30  	pfd         poll.FD
    31  	isConnected bool // handshake completed or use of association with peer
    32  }
    33  
    34  func (r *Resolver) lookup(ctx context.Context, name string, qtype dnsmessage.Type, conf *dnsConfig) (dnsmessage.Parser, string, error) {
    35  	panic("unreachable")
    36  }
    37  

View as plain text