Code Monkey home page Code Monkey logo

gotiny's People

Contributors

niubaoshu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gotiny's Issues

Better examples needed that are compatible with `encoding/gob`

I believe better examples should be provided for anyone new to this library that uses the same convention as encoding/gob.

Decoding:

var foo map[string]string
if err = gob.NewDecoder(file).Decode(&foo); err != nil {
  return err
}

Encoding:

buf := new(bytes.Buffer)
if err := gob.NewEncoder(buf).Encode(foo); err != nil {
  return err
}

Note: file is *os.File returned by os.Open(path).

As far as I can tell, your functions don't return any errors. Is this intentional?

Library doesn't seem to work with go modules (go1.11)

Hello.

Your library doesn't work with go modules, as is demonstrated below:

To reproduce:

$ go get github.com/niubaoshu/gotiny
$ cp -r $GOPATH/src/github.com/niubaoshu/gotiny/example /tmp
$ mv /tmp/example/helloworld.go /tmp/example/main.go
$ go mod init main
$ go mod vendor
$ go build
or
$ go build -mod vendor

Output from go build:

# main
./main.go:12:2: undefined: gotiny.Unmarshal
./main.go:12:19: undefined: gotiny.Marshal
./main.go:19:5: dec.DecodeValue undefined (type *gotiny.Decoder has no field or method DecodeValue)
./main.go:19:21: enc.EncodeValue undefined (type *gotiny.Encoder has no field or method EncodeValue)

fatal error when testing using race detector

Hello, am having an issue while using this library with the race detector enabled.

the error message is: fatal error: checkptr: pointer arithmetic result points to invalid allocation

The issue is very easy to reproduce, just use the next code:

package gotiny

import (
	"github.com/niubaoshu/gotiny"
	"testing"
)

func TestGoTinyArray(t *testing.T){
	strings := []string{"1","2"}
	gotiny.Marshal(&strings)
}

Then execute the test with the race detector enabled:
go test -v -race -run TestGoTinyArray

go version: go1.16.14 darwin/amd64

阿尔法质量

你好,这仍然被认为还没有准备好生产吗? 谢谢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.