code: func (s *RepositoriesService) UploadReleaseAsset(ctx context.Context, owner, repo string, id int64, opt *UploadOptions, file *os.File) (*ReleaseAsset, *Response, error) {
  	u := fmt.Sprintf("repos/%s/%s/releases/%d/assets", owner, repo, id)
  	u, err := addOptions(u, opt)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	stat, err := file.Stat()
  	if err != nil {
  		return nil, nil, err
  	}
  	if stat.IsDir() {
  		return nil, nil, errors.New("the asset to upload can't be a directory")
  	}
  
  	mediaType := mime.TypeByExtension(filepath.Ext(file.Name()))
  	if opt.MediaType != "" {
  		mediaType = opt.MediaType
  	}
  
  	req, err := s.client.NewUploadRequest(u, file, stat.Size(), mediaType)
  	if err != nil {
  		return nil, nil, err
  	}
  
  	asset := new(ReleaseAsset)
  	resp, err := s.client.Do(ctx, req, asset)
  	if err != nil {
  		return nil, resp, err
  	}
  	return asset, resp, nil
  }
docs: // UploadReleaseAsset creates an asset by uploading a file into a release repository.
  // To upload assets that cannot be represented by an os.File, call NewUploadRequest directly.
  //
  // GitHub API docs: https://developer.github.com/v3/repos/releases/#upload-a-release-asset