Benign go Download

github.com/cloudwego/gopkg v0.0.0-20250226090159-31bcaec4d389

Legitimate Go library code

Contains an unbounded block loopGitHub Actions workflow definition path
SHA-256662f8608b3b7757e8d1e9d6d621c3029e261b017ec64ef673ba7ee265c24a292

Evidence

imports encoding/binary encode_test.go · lines 11–45
11:48… , either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package ttheader
16
17import (
18 "context"
19 "encoding/binary"
20 "net"
21 "reflect"
22 "sync"
23 "testing"
24
25 "github.com/cloudwego/gopkg/bufiox"
26)
27
28var seqId int32
29
30func TestEncodeToBytes(t *testing.T) {
31 seqId++
32 encodeParam := EncodeParam{
33 Flags: 0,
34 SeqID: seqId,
35 ProtocolID: 0,
36 IntInfo: map[uint16]string{
37 ToService: "to.service",
38 ToCluster: "to.cluster",
39 ToMethod: "method",
⋯6 lines
Writes a 32-bit big-endian value in Go encode_test.go · lines 49–55
49:12… nil {
50 t.Fatalf("encode to bytes failed, %s", err.Error())
51 }
52 binary.BigEndian.PutUint32(buf, uint32(len(buf)-4))
53 decodeParam, err := DecodeFromBytes(context.Background(), buf)
54 if err != nil {
55 t.Fatalf("encode to …
Go goroutine launch call encode_test.go · lines 65–75
65 var decodeParam DecodeParam
66 var wg sync.WaitGroup
67 wg.Add(1)
68 go func() {
69 defer wg.Done()
70 conn, err := l.Accept()
⋯5 lines
Writes a 16-bit big-endian value in Go binary.go · lines 51–62
51:41… f []byte, typeID TType, id int16) int {
52 buf[0] = byte(typeID)
53 binary.BigEndian.PutUint16(buf[1:], uint16(id))
54 return 3
55}
⋯7 lines
Go reads a delimited line binary.go · lines 255–267
255:33… msgTypeMask)
256
257 off := 4
258
259 // read method name
260 name, l, err1 := p.ReadString(buf[off:])
261 if err1 != nil {
262 return "", 0, 0, 0, errReadMessage
⋯5 lines

Showing the top 5 files — 2 more files (19 regions) not shown.

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.