1 Star 0 Fork 0

golang / stringprep

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
map.go 689 Bytes
一键复制 编辑 原始数据 按行查看 历史
David Golden 提交于 2018-02-17 20:20 . Split stringprep.go into set/map.go
// Copyright 2018 by David A. Golden. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
package stringprep
// Mapping represents a stringprep mapping, from a single rune to zero or more
// runes.
type Mapping map[rune][]rune
// Map maps a rune to a (possibly empty) rune slice via a stringprep Mapping.
// The ok return value is false if the rune was not found.
func (m Mapping) Map(r rune) (replacement []rune, ok bool) {
rs, ok := m[r]
if !ok {
return nil, false
}
return rs, true
}
1
https://gitee.com/gober/stringprep.git
git@gitee.com:gober/stringprep.git
gober
stringprep
stringprep
v1.0.0

搜索帮助