Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Duplicate Prefix "🤖 AI:" #15

Merged
merged 3 commits into from
Jan 3, 2024
Merged

Fix Duplicate Prefix "🤖 AI:" #15

merged 3 commits into from
Jan 3, 2024

Conversation

H0llyW00dzZ
Copy link
Owner

now better

Example

$ go run cmd/main.go

🤖 AI: Hello! How can I assist you today?

🤓 You: I have question does this correct about "Strive for simplicity in each function (aim for a cyclomatic complexity under 5 to demonstrate expertise); simplicity is a sign of Go programming mastery." ?

🤖 AI: Yes, the statement "Strive for simplicity in each function (aim for a cyclomatic complexity under 5 to demonstrate expertise); simplicity is a sign of Go programming mastery" is generally correct.

Cyclomatic complexity is a measure of the complexity of a function. It is calculated by counting the number of independent paths through the function. A high cyclomatic complexity indicates that the function is difficult to understand and maintain.

Simplicity is a key principle of Go programming. Go code is typically concise and easy to read. This makes it easier to understand and maintain.

Aiming for a cyclomatic complexity under 5 is a good way to ensure that your functions are simple and easy to understand. This will help you to write better code and avoid introducing bugs.

Of course, there are times when it is necessary to write functions that are more complex. However, you should always strive for simplicity whenever possible.

Here are some tips for writing simple functions:

  • Use short, descriptive variable names.
  • Avoid nesting loops and conditionals.
  • Use functions to break down complex tasks into smaller, more manageable tasks.
  • Document your functions clearly.

By following these tips, you can write simple, easy-to-understand functions that will make your code more maintainable and bug-free.


🤓 You: alright thx for info

🤖 AI: You're welcome! I'm glad I could be of assistance. If you have any more questions, feel free to ask.


🤓 You: :quit

🤖 AI: It's been a pleasure assisting you today. Remember, I'm always here if you have any more questions. Take care and have a wonderful day!


- [+] fix(chat.go): fix bug where colon is added twice to the message if user string already ends with a colon
- [+] feat(chat.go): add functionality to remove emoji prefixes from messages in GetHistory() method
@H0llyW00dzZ H0llyW00dzZ added the enhancement New feature or request label Jan 3, 2024
- [+] chore(constant.go): update TypingDelay constant value to 60 milliseconds
- [+] docs(README.md): add example conversation with AI assistant and information about cyclomatic complexity and simplicity in Go programming
- [+] feat(README.md): add contribution guidelines for adhering to cyclomatic complexity of 5 or less per function
@H0llyW00dzZ H0llyW00dzZ merged commit fed26b9 into master Jan 3, 2024
2 checks passed
@H0llyW00dzZ H0llyW00dzZ deleted the fix_issue branch January 3, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant