On Sun, 16 Oct 2016, 8:17 AM Tong Sun <suntong...@gmail.com> wrote:

> Hi,
>
> Need help again.
>
> I got everything tested out correctly, in
> https://github.com/suntong/lang/blob/master/lang/Go/src/ds/PersistentData-GOB.go,
> but when I tried to apply it to my real case (more complicated data
> structure), it doesn't work any more. I've put my code at,
>
> http://gopkg.in/suntong/deduper.v1
> i.e., https://github.com/suntong/deduper/tree/v1.2
>
> Here is the relevant piece:
>
>  mh := minhash.New(cfg.bands, cfg.rows, cfg.shingles)
>  persistName := "mh.gob"
>  RestoreState(persistName, mh)
>  defer SaveState(persistName, mh)
>
>
> The same code works well in
> https://github.com/suntong/lang/blob/master/lang/Go/src/ds/PersistentData-GOB.go,
> but in my deduper.v1, after the program is run, that "defer SaveState"
> should have saved something, but the mh.gob is still an empty file:
>
> $ ls -l mh.gob
> -rw-rw---- 1 tong tong *22* 2016-10-15 15:13 mh.gob
>
> What might be the cause?
> How to fix it?
>

You don't seem to check for errors in your restore and save calls. How do
you know that your save is actually working?


> Thanks
>
> On Sunday, February 7, 2016 at 10:18:16 PM UTC-5, Tong Sun wrote:
>
>
> On Sunday, February 7, 2016 at 8:29:29 PM UTC-5, Michael Jones wrote:
>
> ha ha! I was typing the same thing. Matt types faster. ;-)
>
>
> Thank you both!
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to