We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7fedacc commit b667f40Copy full SHA for b667f40
websites/code/studygolang/src/service/project.go
@@ -335,7 +335,15 @@ func ParseOneProject(projectUrl string) error {
335
project.Uri = uri
336
project.Repo = strings.TrimSpace(doc.Find("#Body .github-widget").AttrOr("data-repo", ""))
337
project.Src = "https://github.com/" + project.Repo
338
- project.Author = project.Repo[:strings.Index(project.Repo, "/")]
+
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
347
348
if project.Doc == "" {
349
// TODO:暂时认为一定是 Go 语言
0 commit comments