Skip to content

Commit ca7cd08

Browse files
scottfeldmandeadprogram
authored andcommitted
add lookupProtocol for windows
This fixes a problem with #36 which causes the Windows TinyGO build to fail. The problem is the function lookupProtocol was missing for Windows build. This PR adds the function for Windows. I can't really test this because I don't have a Windows system, but by inspection is seems like it's correct.
1 parent 4927c84 commit ca7cd08

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lookup_windows.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// TINYGO: The following is copied and modified from Go 1.22.0 official implementation.
2+
3+
// Copyright 2009 The Go Authors. All rights reserved.
4+
// Use of this source code is governed by a BSD-style
5+
// license that can be found in the LICENSE file.
6+
7+
package net
8+
9+
import (
10+
"context"
11+
"errors"
12+
)
13+
14+
// lookupProtocol looks up IP protocol name and returns correspondent protocol number.
15+
func lookupProtocol(ctx context.Context, name string) (int, error) {
16+
return 0, errors.New("net:lookupProtocol not implemented")
17+
}

0 commit comments

Comments
 (0)