Skip to content

Instantly share code, notes, and snippets.

package main
import "fmt"
func main() {
var count = Count([]int{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,}, 1)
fmt.Println(count)
}
@panxue
panxue / main.go
Last active May 6, 2019 06:20
自定义json输出
package main
import (
"bytes"
"encoding/json"
"fmt"
"strconv"
"time"
)
// Person : for test struct
type Person struct {
@panxue
panxue / main.go
Created April 25, 2019 09:05
unicode to Chinese
package main
import (
"fmt"
"strconv"
)
func main() {
var str = "\u90ae\u653f\u5feb\u9012\u5305\u88f9"
package main
import "fmt"
func main() {
var input = "Aasdefasefsa"
var Len, maxLen = 128, 129
var position = make([]int, Len)
package util
import (
"bufio"
"fmt"
"os"
"path/filepath"
)
func WriteFile(str string, filename string) {
package main
import (
"crypto/md5"
"fmt"
"io"
"os"
)
func main() {
package main
import (
"bufio"
"io"
"os"
"bytes"
"fmt"
)