Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQUEST] Add GetName function to Job #582

Closed
JohnRoesler opened this issue Sep 29, 2023 Discussed in #581 · 0 comments · Fixed by #583
Closed

[FEATURE REQUEST] Add GetName function to Job #582

JohnRoesler opened this issue Sep 29, 2023 Discussed in #581 · 0 comments · Fixed by #583

Comments

@JohnRoesler
Copy link
Contributor

Discussed in #581

Originally posted by mitjafelicijan September 29, 2023
I want to print out a table in console of all the registered jobs, and I am having difficulties accessing those fields. This goes for a name particularly.

s.Every(5).Seconds().Name("somejob").Tag("sometag").Do(func() {
    fmt.Println("say something") 
}

for _, j := range s.Jobs() {
    fmt.Println(j)
}

This is the output I get:

&{0xc00001e198 {[246 117 117 190 84 191 68 235 148 179 141 122 35 140 157 133] 0xc0000a4280 {<nil> <nil> <nil> <nil> <nil> <nil>} 0x4c3f00 [] 0 somejob main.main.func1 {false 0 0} <nil> <nil> 0xc00001a1e8 0xc0000a41e0 0x49c980 0xc00001a1d0 0xc00001a1d8 0xc00001a1e0 <nil> <nil> 0xc00001a1f0 {0 0 <nil>}} 5 {<nil> false [0 0]} 0 1 true [] {0 0 <nil>} <nil> [] [] [sometag] <nil> <nil> false}</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant