chromedp / cdproto

Package cdproto contains the generated commands, types, and events for the Chrome DevTools Protocol domains.
MIT License
145 stars 54 forks source link

jsonUnmarshal fail from a jsonMarshal result of *network.Cookie #7

Closed bronze1man closed 4 years ago

bronze1man commented 4 years ago

follow code will panic:

package main

import (
    "github.com/chromedp/cdproto/network"
    "encoding/json"
)
func main() {
    b,err:=json.Marshal(&network.Cookie{})
    if err!=nil{
        panic(err)
    }
    var c *network.Cookie
    err=json.Unmarshal(b,&c)
    if err!=nil{
        panic(err)
    }
    return
}