[go-nuts] Re: http "alt" attribute value for img tag?

2018-04-19 Thread Victor L

i am trying html Parse method from "html"* package but can't find element 
"img" ...*

*Any ideas?*

var f func(*html.Node)

f = func(n *html.Node) {

if n.Type == html.ElementNode { //&& n.Data == "alt" {

for _, a := range n.Attr {

//if a.Key == "img" {

fmt.Printf("a.key=%s a.val=%s\n", a.Key, a.Val)

break

//}

}

}

for c := n.FirstChild; c != nil; c = c.NextSibling {

f(c)

}

}

f(doc)

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] mysql driver ?

2016-08-02 Thread Victor L
I have to query mysql database in my code...Do i need to add github mackage
for mysql driver?
import (
_ "github.com/go-sql-driver/mysql"
)
Or is it already in "database/sql" and i need to register it?

Thanks,
-Victor

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[go-nuts] post method in golang?

2016-07-28 Thread Victor L
I am using curl for REST call from json file, like the following:
curl  -X POST -H "Content-Type: application/json"
http://127.0.0.1:8080/v2/apps?force=true -d...@deploy.json
How can I translate this to "golang"  POST method? More specifically, how
can i create request object from json file?
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.