func (c *Resumable) Start() {
	c.channel <- 2
}
Start set upload state to uploading
package resumable
import (
	"bytes"
	"fmt"
	"io/ioutil"
	"math"
	"net/http"
	"os"
	"path/filepath"
	"runtime"
	"sync"
)
const (
	stopped = 0
	paused  = 1
	running = 2
)
var WG sync.WaitGroup
type Resumable struct {
	client    *http.Client
	url       string
	filePath  string
	id        string
	chunkSize int
	file      *os.File
	channel   chan int
	Status    UploadStatus
	debug     bool
}
type UploadStatus struct {
	Size             int64
	SizeTransferred  int64
	Parts            uint64
	PartsTransferred uint64
}
func New(url string, filePath string, client *http.Client, chunkSize int, debug bool) *Resumable {
	resumable := &Resumable{
		client:    client,
		url:       url,
		filePath:  filePath,
		id:        generateSessionID(),
		chunkSize: chunkSize,
		debug:     debug,
		Status: UploadStatus{
			Size:             0,
			SizeTransferred:  0,
			Parts:            0,
			PartsTransferred: 0,
		},
	}
	return resumable
}
func (c *Resumable) Init() {
	fileStat, err := os.Stat(c.filePath)
	checkError(err)
	c.Status.Size = fileStat.Size()
	c.Status.Parts = uint64(math.Ceil(float64(c.Status.Size) / float64(c.chunkSize)))
	c.channel = make(chan int, 1)
	c.file, err = os.Open(c.filePath)
	checkError(err)
	defer c.file.Close()
	WG.Add(1)
	go func() {
		c.upload()
		c = nil
		WG.Done()
	}()
}