3 ms·
I‘ve checked the repo and this looks a litte AI generated to me.
by brodo 1y ago
I‘ve checked the repo and this looks a litte AI generated to me.
- hotpocket777 1y agoMore than a little
- stevekemp 1y agoFlagged this submission for that very reason.
- kgeist 1y agoI gave ChatGPT the project's README and asked it to write Go code based on it. The code it produced was very similar in structure to the original, with many parts almost identical. For example, what ChatGPT gave me: func (q *Queue) Enqueue(b []byte) error { if len(b) > maxBodySize { return fmt.Errorf("payload too large") } q.mu.Lock() defer q.mu.Unlock() if len(q.data) >= q.maxMsg || q.bytes+len(b) > q.maxB { return errors.New("queue full") } cp := append([]byte(nil), b...) q.data = append(q.data, cp) q.bytes += len(cp) atomic.AddUint64(&q.enqueueCnt, 1) return nil } The project: func (q *queue) enqueue(b []byte) error { if len(b) > maxBody { return errors.New("payload too large") } q.mu.Lock() defer q.mu.Unlock() if len(q.data) >= maxMsgs || q.bytes+int64(len(b)) > maxBytes { return errors.New("queue full") } cp := append([]byte(nil), b...) q.data = append(q.data, cp) q.bytes += int64(len(cp)) atomic.AddUint64(&enqueueCnt, 1) return nil }