Skip to content

Commit

Permalink
fixed #2 comment error
Browse files Browse the repository at this point in the history
fixed #2 comment error
  • Loading branch information
werbenhu committed Jun 5, 2023
1 parent 8a49858 commit d726434
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 33 deletions.
8 changes: 4 additions & 4 deletions examples/group/digo.generated.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package main
import "github.com/werbenhu/digo"

// init_main_user_name registers the singleton object with ID main.user.name into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("main.user.name")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("main.user.name")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_main_user_name() {
Expand All @@ -16,7 +16,7 @@ func init_main_user_name() {
}

// init_main_role_name registers the singleton object with ID main.role.name into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("main.role.name")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("main.role.name")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_main_role_name() {
Expand All @@ -25,7 +25,7 @@ func init_main_role_name() {
}

// Add a member object to group: controllers
// Now you can retrieve the group's member objects by using `objs, err := di.Members("controllers")`.
// Now you can retrieve the group's member objects by using `objs, err := digo.Members("controllers")`.
// The objs obtained from the above code are of type `[]any`.
// You will need to forcefully cast the objs to their corresponding actual object types.
func group_controllers_NewUserController() {
Expand All @@ -39,7 +39,7 @@ func group_controllers_NewUserController() {
}

// Add a member object to group: controllers
// Now you can retrieve the group's member objects by using `objs, err := di.Members("controllers")`.
// Now you can retrieve the group's member objects by using `objs, err := digo.Members("controllers")`.
// The objs obtained from the above code are of type `[]any`.
// You will need to forcefully cast the objs to their corresponding actual object types.
func group_controllers_NewRoleController() {
Expand Down
13 changes: 5 additions & 8 deletions examples/multipackage/controllers/digo.generated.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@

//
// This file is generated by digogen. Run 'digogen' to regenerate.
//
// You can install this tool by running `go install github.com/werbenhu/digo/digogen`.
// For more details, please refer to https://github.com/werbenhu/digo.
//
// For more details, please refer to https://github.com/werbenhu/digo.
package controllers

import "github.com/werbenhu/digo"

// init_main_role_name registers the singleton object with ID main.role.name into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("main.role.name")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("main.role.name")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_main_role_name() {
Expand All @@ -19,7 +16,7 @@ func init_main_role_name() {
}

// init_main_user_name registers the singleton object with ID main.user.name into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("main.user.name")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("main.user.name")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_main_user_name() {
Expand All @@ -28,7 +25,7 @@ func init_main_user_name() {
}

// Add a member object to group: group.controllers
// Now you can retrieve the group's member objects by using `objs, err := di.Members("group.controllers")`.
// Now you can retrieve the group's member objects by using `objs, err := digo.Members("group.controllers")`.
// The objs obtained from the above code are of type `[]any`.
// You will need to forcefully cast the objs to their corresponding actual object types.
func group_group_controllers_NewRoleController() {
Expand All @@ -42,7 +39,7 @@ func group_group_controllers_NewRoleController() {
}

// Add a member object to group: group.controllers
// Now you can retrieve the group's member objects by using `objs, err := di.Members("group.controllers")`.
// Now you can retrieve the group's member objects by using `objs, err := digo.Members("group.controllers")`.
// The objs obtained from the above code are of type `[]any`.
// You will need to forcefully cast the objs to their corresponding actual object types.
func group_group_controllers_NewUserController() {
Expand Down
9 changes: 3 additions & 6 deletions examples/multipackage/database/digo.generated.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@

//
// This file is generated by digogen. Run 'digogen' to regenerate.
//
// You can install this tool by running `go install github.com/werbenhu/digo/digogen`.
// For more details, please refer to https://github.com/werbenhu/digo.
//
// For more details, please refer to https://github.com/werbenhu/digo.
package database

import "github.com/werbenhu/digo"

// init_database_mysql_url registers the singleton object with ID database.mysql.url into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("database.mysql.url")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("database.mysql.url")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_database_mysql_url() {
Expand All @@ -19,7 +16,7 @@ func init_database_mysql_url() {
}

// init_database_mysql registers the singleton object with ID database.mysql into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("database.mysql")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("database.mysql")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_database_mysql() {
Expand Down
7 changes: 2 additions & 5 deletions examples/multipackage/models/digo.generated.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@

//
// This file is generated by digogen. Run 'digogen' to regenerate.
//
// You can install this tool by running `go install github.com/werbenhu/digo/digogen`.
// For more details, please refer to https://github.com/werbenhu/digo.
//
// For more details, please refer to https://github.com/werbenhu/digo.
package models

import (
Expand All @@ -13,7 +10,7 @@ import (
)

// init_model_user registers the singleton object with ID model.user into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("model.user")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("model.user")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_model_user() {
Expand Down
13 changes: 5 additions & 8 deletions examples/simple/digo.generated.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@

//
// This file is generated by digogen. Run 'digogen' to regenerate.
//
// You can install this tool by running `go install github.com/werbenhu/digo/digogen`.
// For more details, please refer to https://github.com/werbenhu/digo.
//
// For more details, please refer to https://github.com/werbenhu/digo.
package main

import "github.com/werbenhu/digo"

// init_main_db_url registers the singleton object with ID main.db.url into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("main.db.url")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("main.db.url")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_main_db_url() {
Expand All @@ -19,7 +16,7 @@ func init_main_db_url() {
}

// init_main_db registers the singleton object with ID main.db into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("main.db")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("main.db")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_main_db() {
Expand All @@ -33,7 +30,7 @@ func init_main_db() {
}

// init_main_redis registers the singleton object with ID main.redis into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("main.redis")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("main.redis")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_main_redis() {
Expand All @@ -42,7 +39,7 @@ func init_main_redis() {
}

// init_main_app registers the singleton object with ID main.app into the DI object manager
// Now you can retrieve the singleton object by using `obj, err := di.Provide("main.app")`.
// Now you can retrieve the singleton object by using `obj, err := digo.Provide("main.app")`.
// The obj obtained from the above code is of type `any`.
// You will need to forcefully cast the obj to its corresponding actual object type.
func init_main_app() {
Expand Down
4 changes: 2 additions & 2 deletions generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (g *Generator) defineProviderFunc(fn *DiFunc) *ast.FuncDecl {

comments := []string{
fmt.Sprintf("\n// %s registers the singleton object with ID %s into the DI object manager", fn.providerFuncName(), fn.ProviderId),
fmt.Sprintf("// Now you can retrieve the singleton object by using `obj, err := di.Provide(\"%s\")`.", fn.ProviderId),
fmt.Sprintf("// Now you can retrieve the singleton object by using `obj, err := digo.Provide(\"%s\")`.", fn.ProviderId),
"// The obj obtained from the above code is of type `any`.",
"// You will need to forcefully cast the obj to its corresponding actual object type.",
}
Expand Down Expand Up @@ -307,7 +307,7 @@ func (g *Generator) defineGroupFunc(fn *DiFunc) *ast.FuncDecl {

comments := []string{
fmt.Sprintf("\n// Add a member object to group: %s", fn.GroupId),
fmt.Sprintf("// Now you can retrieve the group's member objects by using `objs, err := di.Members(\"%s\")`.", fn.GroupId),
fmt.Sprintf("// Now you can retrieve the group's member objects by using `objs, err := digo.Members(\"%s\")`.", fn.GroupId),
"// The objs obtained from the above code are of type `[]any`.",
"// You will need to forcefully cast the objs to their corresponding actual object types.",
}
Expand Down

0 comments on commit d726434

Please sign in to comment.