Skip to content

Instantly share code, notes, and snippets.

@KushNee
KushNee / go_snippet.go
Last active October 5, 2017 04:04
golang-snippets
/*接口变量类型判断标准*/
if v, ok := varI.(T); ok { // checked type assertion
Process(v)
return
}
// varI is not of type T
#encoding = utf-8
import httplib2
import json, sys, re
#from bs4 import BeautifulSoup
true = True
false = False
null = None
def query (self):
translateurl = 'http://openapi.baidu.com/public/2.0/bmt/translate?client_id=30jx9lLPxbMLWt2AKvz6OsSe&q=' + self + '&from=auto&to=zh'