我想用golang中的regex替换字符串中的所有表情符号.
像这样 :
这是一个不错的笑话 - >这是一个不错的笑话[e] [e] [e] [e]
我想检查输出变量是否为map [string]字符串.输出应该是map [string]字符串,它应该是ptr.
我检查了ptr值.但我不知道如果是字符串与否,如何检查地图的关键.
对不起,我的英语不好
import (
"fmt"
"reflect"
)
func Decode(filename string, output interface{}) error {
rv := reflect.ValueOf(output)
if rv.Kind() != reflect.Ptr {
return fmt.Errorf("Output should be a pointer of a map")
}
if rv.IsNil() {
return fmt.Errorf("Output in NIL")
}
fmt.Println(reflect.TypeOf(output).Kind())
return nil
}
Run Code Online (Sandbox Code Playgroud) 我想用Golang处理多域.
像这样,如果浏览器发送请求http://sampledomain.me使用特定的Golang程序处理它,
在其他情况下,我想在一台服务器上安装许多程序并告诉每一台程序,以处理每个域.
所有程序都在监听80,而许多域指向一台服务器.
有谁能够帮我 ?
谢谢...