Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 563 Bytes

File metadata and controls

34 lines (29 loc) · 563 Bytes

selfupdate

单文件程序自动升级库

安装

go get github.com/wsshow/selfupdate

例子

import (
    "fmt"
    "net/http"

    "github.com/wsshow/selfupdate"
)

func doUpdate(url string) error {
    resp, err := http.Get(url)
    if err != nil {
        return err
    }
    defer resp.Body.Close()
    err = selfupdate.Apply(resp.Body, selfupdate.Options{})
    if err != nil {
        // error handling
    }
    return err
}

参考