aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-06-04 00:10:14 +0200
committerTeddy Wing2017-06-04 00:10:14 +0200
commit7e711772def7a5d711500c3c6c37ea41b57ac598 (patch)
treec3c57053359c5442be14ae70bc65f65a3ef4d90a
parentc113de965dea24c44023a9aabcff7f8ee1f0caa0 (diff)
downloadtimetasker-7e711772def7a5d711500c3c6c37ea41b57ac598.tar.bz2
Change `ParseXML()` name to `ModuleParseXML()`
Prefix the function name to make it more obvious what it relates to. Since this function lives in the `timetask` module and will be used in contexts that have nothing to do with Modules.
-rw-r--r--timetask/module.go2
-rw-r--r--timetask/module_test.go4
2 files changed, 3 insertions, 3 deletions
diff --git a/timetask/module.go b/timetask/module.go
index adef4e5..4dde57a 100644
--- a/timetask/module.go
+++ b/timetask/module.go
@@ -13,7 +13,7 @@ type moduleXML struct {
Modules []Module `xml:"response>item"`
}
-func ParseXML(xml_str string) ([]Module, error) {
+func ModuleParseXML(xml_str string) ([]Module, error) {
modules := moduleXML{}
err := xml.Unmarshal([]byte(xml_str), &modules)
if err != nil {
diff --git a/timetask/module_test.go b/timetask/module_test.go
index 6dcfa94..cee87c5 100644
--- a/timetask/module_test.go
+++ b/timetask/module_test.go
@@ -20,8 +20,8 @@ const modules_xml = `<?xml version="1.0" encoding="UTF-8" ?>
</response>
</ajax-response>`
-func TestParseXML(t *testing.T) {
- modules, err := ParseXML(modules_xml)
+func TestModuleParseXML(t *testing.T) {
+ modules, err := ModuleParseXML(modules_xml)
if err != nil {
t.Error(err)
}