Giter Club home page Giter Club logo

Comments (9)

eddycjy avatar eddycjy commented on May 18, 2024

@Devying 这样子使用: redis.StringMap(conn.Do("HGETALL", key))

from go-gin-example.

Devying avatar Devying commented on May 18, 2024

@eddycjy 我用的是ByteSlices

from go-gin-example.

eddycjy avatar eddycjy commented on May 18, 2024

@Devying HGETALL 具体使用什么方法转换,根据你的实际业务场景选用就行了

from go-gin-example.

Devying avatar Devying commented on May 18, 2024

@eddycjy 你的方法更简单一些,对了发现文档有点难理解,如果做redis别的操作有什么好的建议吗

from go-gin-example.

Devying avatar Devying commented on May 18, 2024

像这个方法redis.StringMap(conn.Do("HGETALL", key)) 文档上写的参数是两个,第二个是err。怎么没传呢

from go-gin-example.

eddycjy avatar eddycjy commented on May 18, 2024

@Devying Conn 方法的原型:

Do(commandName string, args ...interface{}) (reply interface{}, err error)

其实不难的,就是 1 + N 的模式,Do 方法是用于命令执行,其余像 StringMap 或 ByteSlices 都只是它针对不同的场景给你提供的便捷解析方法

你觉得文档难理解,首先我觉得是你没有理解它这个包的大概的设计思路。 建议理解包的设计思路,多想想它为什么要这么写 API,就觉得文档很简单了

from go-gin-example.

eddycjy avatar eddycjy commented on May 18, 2024

“做redis别的操作有什么好的建议吗”

实际开发,我们都是根据需要啥样子的值,调用什么解析方法的

from go-gin-example.

Devying avatar Devying commented on May 18, 2024

好的非常感谢

from go-gin-example.

Devying avatar Devying commented on May 18, 2024

@eddycjy 我刚认真看了一下文档,一下子豁然开朗,很清楚了,我准备用用看

from go-gin-example.

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.