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

Custom handler with context #26

Open
LaiArturs opened this issue Sep 3, 2023 · 0 comments
Open

Custom handler with context #26

LaiArturs opened this issue Sep 3, 2023 · 0 comments

Comments

@LaiArturs
Copy link

LaiArturs commented Sep 3, 2023

Hi!

I would like to implement a custom Handler with Play function that uses some context values. Currently when setting up Speech struct the handler seams to be copied and not passed as a pointer. Meaning if I change value in my handler later in code the change is not seen by Speech struct.

Example of my handler implementation for illustrative purposes:

type MyHandler struct {
	myValue		string
}

func (handler *MyHandler) Play(fileName string) error {
	log.Println(handler.myValue)
	return nil
}
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

No branches or pull requests

1 participant