Skip to content

The commands will read files and execute some actions with it. The command will handle the opening files, saving error, report progress and velocity, closing cursor

Notifications You must be signed in to change notification settings

averdecia/read_file_go_parallel_execute_action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Read a file and execute an abstract action with multiple go routines

The commands will read files and execute some actions with it. The command will handle the opening files, saving error, report progress and velocity, closing cursor

To use the lib you should create a class that implement the ICommand interface.

type MyCommand struct {}

func (c *MyCommand) ExecuteAction(element []string) (string, error) {
   fmt.Printf("Element: %v", element)
   return "OK", nil
}

Then you must call the RunProcess function passing the command, input and output filepaths, and the amount of routines to run in parallel

func main(){
   mycommand := &MyCommand{}
   command.RunProcess(mycommand, 10, "/tmp/exampleInput.csv", "/tmp/errorFiles.csv")      // You can use os.Args[1:] to pass the variables to the build 
}

About

The commands will read files and execute some actions with it. The command will handle the opening files, saving error, report progress and velocity, closing cursor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages