Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: test on go 1.23rc1 #52

Merged
merged 5 commits into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go_version: ["~1.20", "~1.21", "~1.22", "1.23rc1"]
go_version: ["~1.20", "~1.21", "~1.22", "~1.23.0-rc.1"]

steps:
- uses: actions/checkout@v4
Expand Down
25 changes: 25 additions & 0 deletions api.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//go:build !go1.24

package phpserialize

import (
"fmt"

"github.com/trim21/go-phpserialize/internal/encoder"
)

func Marshal(v any) ([]byte, error) {
return encoder.Marshal(v)
}

func Unmarshal(data []byte, v any) error {
if len(data) == 0 {
return fmt.Errorf("empty bytes")
}

return unmarshal(data, v)
}

type Unmarshaler interface {
UnmarshalPHP([]byte) error
}
3 changes: 0 additions & 3 deletions internal/encoder/any.go

This file was deleted.

9 changes: 0 additions & 9 deletions internal/encoder/version.go

This file was deleted.

9 changes: 0 additions & 9 deletions marshal.go

This file was deleted.

12 changes: 0 additions & 12 deletions unmarshal.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,6 @@ import (
"github.com/trim21/go-phpserialize/internal/errors"
)

type Unmarshaler interface {
UnmarshalPHP([]byte) error
}

func Unmarshal(data []byte, v any) error {
if len(data) == 0 {
return fmt.Errorf("empty bytes")
}

return unmarshal(data, v)
}

func unmarshal(data []byte, v any) error {
rv := reflect.ValueOf(v)

Expand Down