cident

package module
v0.0.0-...-40ceda9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2019 License: BSD-3-Clause Imports: 2 Imported by: 0

README

C标识符 - 生成C标识符

package main

import (
	"fmt"

	"github.com/chai2010/cident"
)

func main() {
	fmt.Println(cident.New("main", "main"))
	fmt.Println(cident.New("path/to/pkg", "main", "count"))
	fmt.Println(cident.New("github.com/chai2010/pbgo", "HttpRule"))
	fmt.Println(cident.New("主包", "主函数"))

	// Output:
	// $main_$main
	// $path_to_pkg_$main_$count
	// $github_com_chai2010_pbgo_$HttpRule
	// $主包_$主函数
}

Documentation

Overview

映射标识符名字.

Example
package main

import (
	"fmt"

	"github.com/chai2010/cident"
)

func main() {
	fmt.Println(cident.New("main", "main"))
	fmt.Println(cident.New("path/to/pkg", "main", "count"))
	fmt.Println(cident.New("github.com/chai2010/pbgo", "HttpRule"))
	fmt.Println(cident.New("主包", "主函数"))

}
Output:
$main_$main
$path_to_pkg_$main_$count
$github_com_chai2010_pbgo_$HttpRule
$主包_$主函数

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(pkg string, scopeId ...string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL