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

i was not able to add Color in the Attachment #22

Open
sajjasivakumar opened this issue Feb 8, 2022 · 1 comment
Open

i was not able to add Color in the Attachment #22

sajjasivakumar opened this issue Feb 8, 2022 · 1 comment

Comments

@sajjasivakumar
Copy link

sajjasivakumar commented Feb 8, 2022

Hi i was not able to add Color in the Attachment can you please help on this

how do you add Color to slack message if fail i want to mark it red

attachment := slack.Attachment{
Color: "#1766ff",
}

it was throwing error
`cannot use "red" (untyped string constant) as *string value in struct literalcompiler[IncompatibleAssign](https://pkg.go.dev/golang.org/x/tools/internal/typesinternal?utm_source%3Dgopls#IncompatibleAs
Screenshot 2022-02-09 at 12 17 13 AM
sign)

`

@bany-olli
Copy link

@sajjasivakumar hi, you can assign a value for attachment.Color like this:

Color := "#1766ff"
attachment1 := Attachment{
	Color: &Color,
}

Hope this trick will help you !

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

2 participants