Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
34a0580e
提交
34a0580e
authored
9月 16, 2014
作者:
Juan Batiz-Benet
提交者:
Brian Tiger Chow
9月 22, 2014
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
godep multiaddr update
上级
70ea4f54
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
44 行增加
和
4 行删除
+44
-4
Godeps.json
Godeps/Godeps.json
+2
-2
index.go
...ps/_workspace/src/github.com/jbenet/go-multiaddr/index.go
+6
-0
multiaddr_test.go
...pace/src/github.com/jbenet/go-multiaddr/multiaddr_test.go
+34
-0
message.pb.go
crypto/spipe/message.pb.go
+1
-1
messages.pb.go
routing/dht/messages.pb.go
+1
-1
没有找到文件。
Godeps/Godeps.json
浏览文件 @
34a0580e
...
@@ -60,8 +60,8 @@
...
@@ -60,8 +60,8 @@
},
},
{
{
"ImportPath"
:
"github.com/jbenet/go-multiaddr"
,
"ImportPath"
:
"github.com/jbenet/go-multiaddr"
,
"Comment"
:
"0.1.2-
2-g0624ab3
"
,
"Comment"
:
"0.1.2-
3-g74443fc
"
,
"Rev"
:
"
0624ab3bf754d013585c5d07f0100ba34901a689
"
"Rev"
:
"
74443fca319c4c2f5e9968b8e268c30a4a74dc64
"
},
},
{
{
"ImportPath"
:
"github.com/jbenet/go-multihash"
,
"ImportPath"
:
"github.com/jbenet/go-multihash"
,
...
...
Godeps/_workspace/src/github.com/jbenet/go-multiaddr/index.go
浏览文件 @
34a0580e
package
multiaddr
package
multiaddr
import
(
import
(
"bytes"
"fmt"
"fmt"
"strings"
"strings"
)
)
...
@@ -19,6 +20,11 @@ func NewMultiaddr(s string) (*Multiaddr, error) {
...
@@ -19,6 +20,11 @@ func NewMultiaddr(s string) (*Multiaddr, error) {
return
&
Multiaddr
{
Bytes
:
b
},
nil
return
&
Multiaddr
{
Bytes
:
b
},
nil
}
}
// Equal tests whether two multiaddrs are equal
func
(
m
*
Multiaddr
)
Equal
(
m2
*
Multiaddr
)
bool
{
return
bytes
.
Equal
(
m
.
Bytes
,
m2
.
Bytes
)
}
// String returns the string representation of a Multiaddr
// String returns the string representation of a Multiaddr
func
(
m
*
Multiaddr
)
String
()
(
string
,
error
)
{
func
(
m
*
Multiaddr
)
String
()
(
string
,
error
)
{
return
bytesToString
(
m
.
Bytes
)
return
bytesToString
(
m
.
Bytes
)
...
...
Godeps/_workspace/src/github.com/jbenet/go-multiaddr/multiaddr_test.go
浏览文件 @
34a0580e
...
@@ -6,6 +6,40 @@ import (
...
@@ -6,6 +6,40 @@ import (
"testing"
"testing"
)
)
func
newMultiaddr
(
t
*
testing
.
T
,
a
string
)
*
Multiaddr
{
m
,
err
:=
NewMultiaddr
(
a
)
if
err
!=
nil
{
t
.
Error
(
err
)
}
return
m
}
func
TestEqual
(
t
*
testing
.
T
)
{
m1
:=
newMultiaddr
(
t
,
"/ip4/127.0.0.1/udp/1234"
)
m2
:=
newMultiaddr
(
t
,
"/ip4/127.0.0.1/tcp/1234"
)
m3
:=
newMultiaddr
(
t
,
"/ip4/127.0.0.1/tcp/1234"
)
if
m1
.
Equal
(
m2
)
{
t
.
Error
(
"should not be equal"
)
}
if
m2
.
Equal
(
m1
)
{
t
.
Error
(
"should not be equal"
)
}
if
!
m2
.
Equal
(
m3
)
{
t
.
Error
(
"should be equal"
)
}
if
!
m3
.
Equal
(
m2
)
{
t
.
Error
(
"should be equal"
)
}
if
!
m1
.
Equal
(
m1
)
{
t
.
Error
(
"should be equal"
)
}
}
func
TestStringToBytes
(
t
*
testing
.
T
)
{
func
TestStringToBytes
(
t
*
testing
.
T
)
{
testString
:=
func
(
s
string
,
h
string
)
{
testString
:=
func
(
s
string
,
h
string
)
{
...
...
crypto/spipe/message.pb.go
浏览文件 @
34a0580e
...
@@ -14,7 +14,7 @@ It has these top-level messages:
...
@@ -14,7 +14,7 @@ It has these top-level messages:
*/
*/
package
spipe
package
spipe
import
proto
"code.google.com/p/gogoprotobuf/proto"
import
proto
"
github.com/jbenet/go-ipfs/Godeps/_workspace/src/
code.google.com/p/gogoprotobuf/proto"
import
json
"encoding/json"
import
json
"encoding/json"
import
math
"math"
import
math
"math"
...
...
routing/dht/messages.pb.go
浏览文件 @
34a0580e
...
@@ -13,7 +13,7 @@ It has these top-level messages:
...
@@ -13,7 +13,7 @@ It has these top-level messages:
*/
*/
package
dht
package
dht
import
proto
"code.google.com/p/gogoprotobuf/proto"
import
proto
"
github.com/jbenet/go-ipfs/Godeps/_workspace/src/
code.google.com/p/gogoprotobuf/proto"
import
json
"encoding/json"
import
json
"encoding/json"
import
math
"math"
import
math
"math"
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论