Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b667f40

Browse files
committed
bugfix:author
1 parent 7fedacc commit b667f40

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

websites/code/studygolang/src/service/project.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,15 @@ func ParseOneProject(projectUrl string) error {
335335
project.Uri = uri
336336
project.Repo = strings.TrimSpace(doc.Find("#Body .github-widget").AttrOr("data-repo", ""))
337337
project.Src = "https://github.com/" + project.Repo
338-
project.Author = project.Repo[:strings.Index(project.Repo, "/")]
338+
339+
pos := strings.Index(project.Repo, "/")
340+
if pos > -1 {
341+
project.Author = project.Repo[:pos]
342+
} else {
343+
project.Author = "网友"
344+
}
345+
346+
// TODO: logo
339347

340348
if project.Doc == "" {
341349
// TODO:暂时认为一定是 Go 语言

0 commit comments

Comments
 (0)