Skip to content

Commit

Permalink
Merge pull request #135 from y-yagi/fix-ci
Browse files Browse the repository at this point in the history
Migrate CI to GitHub Actions
  • Loading branch information
h2non committed Sep 22, 2023
2 parents cfcd7d0 + 0f0b5cb commit 3ce14a5
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 33 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,33 @@
name: CI
on:
push:
branches:
- master

pull_request:

jobs:
test:
strategy:
matrix:
go-version: ["1.19", "1.20", "1.21"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- run: go test ./...

lint:
strategy:
matrix:
go-version: ["1.21"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- run: diff -u <(echo -n) <(gofmt -s -d ./)
- run: diff -u <(echo -n) <(go vet ./...)
16 changes: 0 additions & 16 deletions .travis.yml

This file was deleted.

32 changes: 16 additions & 16 deletions matchers/archive.go
Expand Up @@ -191,21 +191,21 @@ func MachO(buf []byte) bool {
// There are two frame formats defined by Zstandard: Zstandard frames and Skippable frames.
// See more details from https://tools.ietf.org/id/draft-kucherawy-dispatch-zstd-00.html#rfc.section.2
func Zst(buf []byte) bool {
if compareBytes(buf, zstdMagic, 0) {
return true
} else {
if compareBytes(buf, zstdMagic, 0) {
return true
} else {
// skippable frames
if len(buf) < 8 {
return false
}
if binary.LittleEndian.Uint32(buf[:4]) & ZstdMagicSkippableMask == ZstdMagicSkippableStart {
userDataLength := binary.LittleEndian.Uint32(buf[4:8])
if len(buf) < 8 + int(userDataLength) {
return false
}
nextFrame := buf[8+userDataLength:]
return Zst(nextFrame)
}
return false
}
if len(buf) < 8 {
return false
}
if binary.LittleEndian.Uint32(buf[:4])&ZstdMagicSkippableMask == ZstdMagicSkippableStart {
userDataLength := binary.LittleEndian.Uint32(buf[4:8])
if len(buf) < 8+int(userDataLength) {
return false
}
nextFrame := buf[8+userDataLength:]
return Zst(nextFrame)
}
return false
}
}
2 changes: 1 addition & 1 deletion matchers/document.go
Expand Up @@ -44,7 +44,7 @@ const (
TYPE_ODT
)

//reference: https://bz.apache.org/ooo/show_bug.cgi?id=111457
// reference: https://bz.apache.org/ooo/show_bug.cgi?id=111457
func Doc(buf []byte) bool {
if len(buf) > 513 {
return buf[0] == 0xD0 && buf[1] == 0xCF &&
Expand Down

0 comments on commit 3ce14a5

Please sign in to comment.