Golang & Libsass, what am i doing wrong?

xuanbao · · 1071 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>I&#39;m lacking some basic information about cbindings &amp; go. In short, i&#39;m trying to find a library that uses <a href="https://github.com/sass/libsass">libsass</a> to compile Sass, in go. In the libsass <a href="https://github.com/sass/libsass/wiki/Implementations#go">implementations wiki</a> there are 4 implementations listed.</p> <p>So far, go_sass is the only one i&#39;ve gotten to work - and that&#39;s because it comes with everything (including a libsass installer), but most importantly the interface files. The downside to this one, is that it only works on a specific version of libsass. If the user who is building the Go code has a different version, go_sass will fail.</p> <p>gosass and go-sass <em>(i&#39;m going by memory here)</em> both immediately fail with variations of a missing sass_interface file. My attempts to supply one have failed, though i&#39;m likely doing something obvious wrong.</p> <p>So my question is basically.. what am i doing wrong? I&#39;m likely doing many things wrong heh, but are cbindings this difficult to deal with?</p> <p>I&#39;m trying to build a library that uses a sass compiler, but more importantly than my problems, it seems to me that anyone who downloads <em>my</em> library, will have a hell of a time simply compiling it due to the cbinding dependencies of go-sass &amp; friends.</p> <p>So what do you recommend? My main concern is making an easy to distribute library. Will this be possible with cbindings?</p> <hr/>**评论:**<br/><br/>ackondro: <pre><p>I got fed up with the same situation (and needed a newer libsass) and threw together this library: <a href="https://github.com/acsellers/sassy">github.com/acsellers/sassy</a>. I built the library for a quick prototype that ended up not getting put into production. It&#39;s a mishmash of libsass code and go code, though I didn&#39;t copy the sass -&gt; scss library that libsass sometimes includes, because of license concerns. Basically I copied the libsass code into the same directory as the go code, then tweaked the go code to use the embedded libsass. So you should be able to just go get ... without having to install libsass as a shared library or whatever.</p> <p>It&#39;s not the prettiest library, but it was convenient enough at the time. I&#39;m not sure I would use it today, instead I would probably end up going with <a href="https://github.com/yosssi/gcss">gcss</a> if I wanted sass-type features in Go.</p></pre>xyproto: <pre><p>I second that. I&#39;m using GCSS in <a href="https://github.com/xyproto/algernon" rel="nofollow">Algernon</a> and it works really well. </p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

1071 次点击  
加入收藏 微博
0 回复
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传