Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irmago
Commits
ce7b9ce6
Commit
ce7b9ce6
authored
Jul 22, 2017
by
Sietse Ringers
Browse files
Remove test functions
parent
4231fbbf
Changes
1
Hide whitespace changes
Inline
Side-by-side
manager.go
View file @
ce7b9ce6
...
...
@@ -4,7 +4,6 @@ import (
"errors"
"io/ioutil"
"math/big"
"net/http"
"os"
"github.com/mhe/gabi"
...
...
@@ -98,43 +97,3 @@ func (cm *CredentialManager) init(path string) (err error) {
return
}
func
Test2
(
path
string
)
(
content
string
,
err
error
)
{
bytes
,
err
:=
ioutil
.
ReadFile
(
path
+
"/file.txt"
)
content
=
string
(
bytes
)
return
}
func
Test
(
path
string
)
(
err
error
)
{
err
=
ioutil
.
WriteFile
(
path
+
"/file.txt"
,
[]
byte
(
"TEST TEST"
),
0755
)
return
}
type
NetworkHandler
interface
{
Success
(
content
string
)
Error
(
status
int
,
error
string
)
}
func
TestNetwork
(
url
string
,
handler
NetworkHandler
)
{
go
func
()
{
resp
,
err
:=
http
.
Get
(
url
)
if
err
!=
nil
{
handler
.
Error
(
0
,
err
.
Error
())
return
}
defer
resp
.
Body
.
Close
()
bytes
,
err
:=
ioutil
.
ReadAll
(
resp
.
Body
)
if
err
!=
nil
{
handler
.
Error
(
0
,
err
.
Error
())
return
}
content
:=
string
(
bytes
)
if
resp
.
StatusCode
<
200
||
resp
.
StatusCode
>
208
{
handler
.
Error
(
resp
.
StatusCode
,
content
)
}
else
{
handler
.
Success
(
content
)
}
}()
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment