Coder Social home page Coder Social logo

add one api for kcp-go version about kcp-go HOT 6 CLOSED

xtaci avatar xtaci commented on May 22, 2024
add one api for kcp-go version

from kcp-go.

Comments (6)

xtaci avatar xtaci commented on May 22, 2024

govendor or glide can easily download given version or upgrade. all stable versions are released under :
https://github.com/xtaci/kcp-go/releases

from kcp-go.

zboya avatar zboya commented on May 22, 2024

Thanks, I want to print kcp-go version in my program.

from kcp-go.

xtaci avatar xtaci commented on May 22, 2024

You need to use some injection technique at compiling time, such as

go build -ldflags "-X main.kcpversion=v3.9"

from kcp-go.

zboya avatar zboya commented on May 22, 2024

这样当然是可以的,但是这样每次的版本得我自己控制了,希望的是直接获取kcp库的版本,谢谢

from kcp-go.

xtaci avatar xtaci commented on May 22, 2024

用脚本编译很容易就获得了,直接写到源码并不合适,这通常都是由编译过程动态注入的。

方法1. git获取当前tag
方法2. govendor /glide 获取当前tag

from kcp-go.

zboya avatar zboya commented on May 22, 2024

嗯嗯,我看到很多库都是在源代码写版本的,因为对于库管理,版本很重要,谢谢回答

from kcp-go.

Related Issues (20)

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.