Skip to content

cyg-pd/go-phpobj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-phpobj

tag Go Version GoDoc Build Status Go report Coverage Contributors License

🚀 Install

go get github.com/cyg-pd/go-phpobj@v1

This library is v1 and follows SemVer strictly.

No breaking changes will be made to exported APIs before v2.0.0.

This library has no dependencies outside the Go standard library.

💡 Usage

You can import go-phpobj using:

import (
	"log/slog"

	"github.com/cyg-pd/go-phpobj"
)

type PHPJSONData struct {
	Data *phpobj.W[struct{ Msg string }]
}

func main() {
	m := []byte(`{"Data":{"Msg":"hi"}}`)
	var w PHPJSONData

	if err := json.Unmarshal(m, &w); err != nil {
		panic(err)
	}

	slog.Info(w.Data.Data().Msg) // hi
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •