
Security News
Open Source Maintainers Demand Ability to Block Copilot-Generated Issues and PRs
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
github.com/go-restruct/restruct
restruct
is a library for reading and writing binary data in Go. Similar to
lunixbochs struc
and encoding/binary
, this library reads data based on the
layout of structures and, like struc
, based on what is contained in struct
tags.
To install Restruct, use the following command:
go get github.com/go-restruct/restruct
restruct
aims to provide a clean, flexible, robust implementation of struct
packing. In the future, through fast-path optimizations and code generation, it
also aims to be quick, but it is currently very slow.
restruct
currently requires Go 1.7+.
package main
import (
"encoding/binary"
"io/ioutil"
"os"
"github.com/go-restruct/restruct"
)
type Record struct {
Message string `struct:"[128]byte"`
}
type Container struct {
Version int `struct:"int32"`
NumRecord int `struct:"int32,sizeof=Records"`
Records []Record
}
func main() {
var c Container
file, _ := os.Open("records")
defer file.Close()
data, _ := ioutil.ReadAll(file)
restruct.Unpack(data, binary.LittleEndian, &c)
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Open source maintainers are urging GitHub to let them block Copilot from submitting AI-generated issues and pull requests to their repositories.
Research
Security News
Malicious Koishi plugin silently exfiltrates messages with hex strings to a hardcoded QQ account, exposing secrets in chatbots across platforms.
Research
Security News
Malicious PyPI checkers validate stolen emails against TikTok and Instagram APIs, enabling targeted account attacks and dark web credential sales.