// UploadFile uploads a file to the dataPath
UploadFile uploads a file to the dataPath
// UploadFile uploads a file to the dataPath
func (s RunnerService) UploadFile(ctx context.Context, r api.UploadFileRequest) (*api.UploadFileResponse, error) {
	path := s.dataPath + r.Name
	file, err := os.Create(path)
	if err != nil {
		return nil, err
	}
	defer file.Close()
	if _, err := file.Write(r.Content); err != nil {
		os.Remove(path)
		return nil, err
	}
	return &api.UploadFileResponse{Path: path}, nil
}
func ( s RunnerService ) UploadFile ( ctx context . Context , r api . UploadFileRequest ) ( * api . UploadFileResponse , error ) { path := s . dataPath + r . Name file , err := os . Create ( path ) if err != nil { return nil , err } defer file . Close ( ) if _ , err := file . Write ( r . Content ) ; err != nil { os . Remove ( path ) return nil , err } return & api . UploadFileResponse { Path : path } , nil }
UploadFile uploads a file to the dataPath
UploadFile uploads a file to the dataPath