Giter Club home page Giter Club logo

uc's Introduction

Using-Concise-Go

How-to-Use

处于开发阶段

敬请期待

Function

目录结构:

  • cal库 计算库

    目前已实现的功能

    import "github.com/nj-jay/uc/cal"

    • cal.Add(a ...interface{})

      空接口类型可以为int, int32, int64, string, []int, float64

      example

    package main
    
    import (
    
        "fmt"
        "github.com/nj-jay/uc/cal"
    )
    func main() {
    
        var a int32
        var b int64
        a = 5
        b = 4
        fmt.Println(cal.Add(a, a))
        fmt.Println(cal.Add(b, b))
        fmt.Println(cal.Add(1, 2, 3))
        fmt.Println(cal.Add(1, 2))
        fmt.Println(cal.Add(1.1, 2.2))
        fmt.Println(cal.Add(2.22, 3.33))
        fmt.Println(cal.Add("I", " ", "love", " ", "go!"))
        fmt.Println(cal.Add("https://", "nj-jay.com"))
        fmt.Println(cal.Add([]int{1, 2}, []int{3, 4}))
    }
    //运行结果
    10
    8
    6
    3
    3.3
    5.55
    I love go!
    https://nj-jay.com
    [1 2 3 4]
  • play库

    目前已实现的功能

    import "github.com/nj-jay/uc/play"

    • play.PlayAudio(s string)

      参数为mp3文件的路径

      example

      package main
      
      import (
      
      
          "github.com/nj-jay/uc/play"
      )
      
      func main() {
          play.PlayAudio("./七里香.mp3")
      }
      //运行结果
      播放音乐音乐播放完退出程序
  • shell库

    shell.Wget(url string) 可以下载网络上的文件 致敬wget命令

    package main
    import (
    	"github.com/nj-jay/uc/shell"
    )
    
    func main() {
    shell.Wget("https://pucture.nj-jay.com/node.tar.xz")
    }
    //运行结果
    2020/10/15 23:37:39 https://picture.nj-jay.com/node.tar.xz
    已发出HTTP/2.0请求, 正在等待回应...200 OK
    长度:	 [ 14781396 byte ] >-- 14434.96 Kb 	[ application/x-xz ]
    正在保存至: node.tar.xz
     14.78 MB / 14.78 MB [====================================] 100.00% 5.81 MB/s 2s
    2020/10/15 23:37:43 已保存 node.tar.xz

    shell.Ls(path string) 致敬ls命令

    package main
    import (
    	"github.com/nj-jay/uc/shell"
    )
    
    func main() {
     if len(os.Args) == 1 {
    		shell.Ls(".")
    	} else {
    		path := os.Args[1]
    		shell.Ls(path)
    	}
    }
    // 编译成二进制文件ls-go
    //运行结果 
    LICENSE   0.1 Kb
    README.md   2.5 Kb
    cal
    example
    go.mod   0.1 Kb
    go.sum   1.1 Kb
    play
    shell
    // ls-go ../
    Somusic
    book
    calcugo
    cgo
    faker
    file
    fileUpload
    fyne
    gif

已完成

  • cal.Add()
  • play.PlayAudio()
  • shell.Wget()
  • shell.Ls()

正在开发的功能

Contributors

nj-jay

xmoon5

uc's People

Contributors

nj-jay avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.