Giter Site home page Giter Site logo

chai2010 / gopherchina2018-cgo-talk Goto Github PK

View Code? Open in Web Editor NEW
332.0 19.0 47.0 8.02 MB

:book: GopherChina2018: 深入CGO编程 - 最新修订

Home Page: https://chai2010.github.io/gopherchina2018-cgo-talk/

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.27% Go 17.00% AppleScript 0.11% SCSS 15.89% JavaScript 66.73%
go golang gopherchina gopherchina2018 cgo

gopherchina2018-cgo-talk's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gopherchina2018-cgo-talk's Issues

11.10节, uintptr 暂存到变量, golang文档不建议

Note that both conversions must appear in the same expression, with only the intervening arithmetic between them:

// INVALID: uintptr cannot be stored in variable
// before conversion back to Pointer.
u := uintptr(p)
p = unsafe.Pointer(u + offset)

反馈信息

我看过最新版的了,感觉这次又多了很多内容啊:)我这边目前能看出来的就是第六章类型转换里页面的顺序有点别扭,比如说第一页是说都有哪些可能的类型转换,然后三页开始介绍unsafe(我觉得第4页放在2和3前头好些?),然后一页是字符串和切片的结构,然后就是各种实战了,当然干货很多,但是是不是按照一个递进的顺序来好一些?比如基础类型是如何对应的,字符串是如何对应的(以及手动申请和释放内存),结构体类型还有最重要的指针类型。当然这个是我从一个cgo初学者的角度来看的,不确定和你演讲的场景是否一致

感谢 @julykobe

windows下使用报错

make-clib-static 文件夹
在windows Cygwin64 Terminal执行make命令报错

$ make
go build -buildmode=c-archive -o number.a

runtime/cgo

gcc_libinit_windows.c: 在函数‘x_cgo_sys_thread_create’中:
gcc_libinit_windows.c:57:12: 错误:implicit declaration of function ‘_beginthread’; did you mean ‘OpenThread’? [-Werror=implicit-function-declaration]
thandle = _beginthread(func, 0, arg);
^~~~~~~~~~~~
OpenThread
cc1:所有的警告都被当作是错误
go: failed to remove work dir: GetFileInformationByHandle D:\cygwin64new\tmp\go-build109746670\NUL: Incorrect function.
make: *** [Makefile:5:default] 错误 2

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.